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
Post a Comment