react router - reactjs - Is it possible to have non nested routes -


i'm playing reactjs routes. in examples routes nested, such

<route path="/" handler={app} >     <route name="about" handler={about} />     <route name="contact" handler={contact} /> </route>  

is possible have simple non nested routes, below?

 <route path="/" handler={app} />  <route name="about" handler={about} />  <route name="contact" handler={contact} /> 

update:

var routes = (     <route name="root" handler={root}>         <route path="/" handler={home} />         <route path="/home" handler={home} />         <route path="/about" handler={about} />         <route path="/projects" handler={projects} />         <route path="/contact" handler={contact} />     </route>  ); 

strange issues, after updating suggested answer below. name not working anymore path works? had update routes. idea?

seems it's not possible. i'm using trick emulate such behavior:

var routes = (     <route name="root" handler={root}>         <route name="checkout" path="/checkout/:step" handler={checkout}/>         <route name="application" path="/" handler={application}>             <defaultroute handler={promo}/>             <route name="agreement" handler={agreement}/>             <route name="policy" handler={policy}/>             <route name="how-it-works" handler={brief}/>             <route name="login" handler={login}/>             <route name="faq" handler={faq}/>             ...             <notfoundroute handler={notfound}/>         </route>         <notfoundroute handler={notfound}/>     </route> ); 

where root basic html page body tag content rendered route handler.

here needed checkout page different page layout on same path segment level agreement or login pages.


Comments

Popular posts from this blog

python - argument must be rect style object - Pygame -

webrtc - Which ICE candidate am I using and why? -

c# - Better 64-bit byte array hash -