reactjs - Make a non-accessible parent route in React Router -


i'm building react app have page tabs display different content, router looks this:

<route path="/" name="home" handler={app}>     <defaultroute handler={home}/>     <route path="tabs" handler={tabs}>         <route path="tab1" name="tab1" handler={tab1}/>         <route path="tab2" name="tab2" handler={tab2}/>     </route> </route> 

this produces following routes:

/ /tabs /tabs/tab1 /tabs/tab2 

i keep same behavior producing following ones (and those):

/ /tab1 /tab2 

any idea how accomplish this?

here jsfiddle demonstrating working.

<route name="root" path="/" handler={app}>     <defaultroute handler={home} />     <route name="tabs" path="tab1" handler={tabs}>         <defaultroute name="tab1" handler={tab1} />         <route name="tab2" path="/tab2" handler={tab2} />     </route> </route> 

Comments

Popular posts from this blog

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -