I have a large application which I am soon to be switching to react-router 1.x.
The application has a large nested navigation structure.
/
/page1
/page1/option1
/page1/option2
/page1/option3
/page1/option4
/page1/option4/option1
/page1/option4/option2
/page1/option4/option3
/page2
/page2/option1
/page2/option2
/page2/option3
/page2/option4
etc..
On /page1 my sub navigation would be:
Option1 | Option2 | Option 3 | Option 4
And on /page/option4
Option1 | Option2 | Option 3
I have been looking for a way to power a sub navigation components off the route config, so the pages would only need to be defined in one place, but so far have not been able to find an example. What would be the normal approach for such a problem, does such an example exist?
Update
So conceptually I'm thinking along the lines of a .net sitemap provider , where the navigation , breadcrumb trail and routing would work off a hierarchical definition of pages. I'm wondering if the route definition for react router can be the source, or can be driven from a different source, and how this would normally be achieved.
<Route path="/" component={App}>
<Route path="page1" component={Page1}>
<Route path="page1/option1" component={Page1Option1} />
<Route path="page1/option2" component={Page1Option2} />
<Route path="page1/option3" component={Page1Option3} />
...