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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -