I keep seeing references to a component called "LeftNav
" in the material-ui react library (example: Material UI - Open LeftNav / Drawer on AppBar click), but I can't find anything about it in the documentation. What is it? How does it differ from Drawer
? Why is it apparently undocumented, despite being hugely popular (at least judging by the number of questions I see about how to use it)? What is its toggle()
method for, and is there a similar method for Drawer
(the documentation suggests not, but for all I would know by reading the documentation there was no such component as LeftNav
at all, so I don't think the documentation can really be trusted here)?
Asked
Active
Viewed 4,774 times
4

Community
- 1
- 1

Periata Breatta
- 468
- 5
- 14
1 Answers
10
<LeftNav/>
is the same as <Drawer/>
. The name was changed from "LeftNav" to "Drawer" with the release of material-UI version 0.15. Take a look at the change log here and you will see this.

CaseyC
- 1,453
- 14
- 23
-
Ah. It would be useful if they retained some kind of pointer in the documentation showing that the name had been changed... it's very confusing reading old code and then trying to use parts of it to find that its components apparently don't exist. So does `Dropdown` have a toggle method? It isn't mentioned in the documentation if it does... – Periata Breatta Sep 28 '16 at 20:35
-
Ah, looking through the changelogs, it seems that method was deprecated in 0.14, which is presumably why there's no documentation for it now. – Periata Breatta Sep 28 '16 at 20:38