@@ -42,7 +42,7 @@ const LeftNav = React.createClass({
4242 disableSwipeToOpen : React . PropTypes . bool ,
4343 docked : React . PropTypes . bool ,
4444 header : React . PropTypes . element ,
45- menuItems : React . PropTypes . array . isRequired ,
45+ menuItems : React . PropTypes . array ,
4646 onChange : React . PropTypes . func ,
4747 onNavOpen : React . PropTypes . func ,
4848 onNavClose : React . PropTypes . func ,
@@ -181,7 +181,27 @@ const LeftNav = React.createClass({
181181 onTouchTap = { this . _onOverlayTouchTap } />
182182 ) ;
183183 }
184-
184+ let children ;
185+ if ( this . props . menuItems === undefined ) {
186+ children = this . props . children ;
187+ }
188+ else {
189+ children = (
190+ < Menu
191+ ref = "menuItems"
192+ style = { this . mergeStyles ( styles . menu ) }
193+ zDepth = { 0 }
194+ menuItems = { this . props . menuItems }
195+ menuItemStyle = { this . mergeStyles ( styles . menuItem ) }
196+ menuItemStyleLink = { this . mergeStyles ( styles . menuItemLink ) }
197+ menuItemStyleSubheader = { this . mergeStyles ( styles . menuItemSubheader ) }
198+ menuItemClassName = { this . props . menuItemClassName }
199+ menuItemClassNameSubheader = { this . props . menuItemClassNameSubheader }
200+ menuItemClassNameLink = { this . props . menuItemClassNameLink }
201+ selectedIndex = { selectedIndex }
202+ onItemTap = { this . _onMenuItemClick } />
203+ ) ;
204+ }
185205 return (
186206 < div className = { this . props . className } >
187207 { overlay }
@@ -195,19 +215,7 @@ const LeftNav = React.createClass({
195215 this . props . openRight && styles . rootWhenOpenRight ,
196216 this . props . style ) } >
197217 { this . props . header }
198- < Menu
199- ref = "menuItems"
200- style = { this . mergeStyles ( styles . menu ) }
201- zDepth = { 0 }
202- menuItems = { this . props . menuItems }
203- menuItemStyle = { this . mergeStyles ( styles . menuItem ) }
204- menuItemStyleLink = { this . mergeStyles ( styles . menuItemLink ) }
205- menuItemStyleSubheader = { this . mergeStyles ( styles . menuItemSubheader ) }
206- menuItemClassName = { this . props . menuItemClassName }
207- menuItemClassNameSubheader = { this . props . menuItemClassNameSubheader }
208- menuItemClassNameLink = { this . props . menuItemClassNameLink }
209- selectedIndex = { selectedIndex }
210- onItemTap = { this . _onMenuItemClick } />
218+ { children }
211219 </ Paper >
212220 </ div >
213221 ) ;
0 commit comments