reactjs - Multiple RouteHandler for a Route -


i need show multiple nav-items based on route. example

var routes = (  <route path="/" handler={wrapper}>   <route handler={navitemmenu} />   <route handler={navitemsave}/>  </route> ); 

and use this

var nav = react.createclass({  render: function() {     return (         <div classname="p-nav-left">          <ul classname="p-navbar-nav">           <routehandler/>             </ul>         </div>       );     }    }); 

i expecting show both "navitemmenu" , "navitemsave".

similarly want show different items different paths. how do this? single route how create multiple handler?

this isn't case of nesting, of alternate routes based on value of -- maybe prop passed in wrapper? i'm having guess little here, maybe want?

let wrapper = react.createclass({     // bunch of code omitted     render() {         let contents = null;     if (this.props.some_value === "x") {         contents = <navitemmenu />     } else {         contents = <navitemsave />     }     return contents;     } }); 


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -