Skip to content

Make nested router #81

@higimo

Description

@higimo

Describe the feature you'd love to see
I need a global context that is only available on a group of routers. And a different context on a different router group. I would like the responsibility of working with URL in the Router. And the context did not check which route it was on and changed its behavior.

Additional context (optional)

<Router>
	<Route path="*" component={ServiceEmailRoute} />
	<Route path="*" component={ServiceStatisticRoute} />
	<Route path="/login/" component={ServiceStatisticRoute} />
</Router>

// ServiceEmailRoute
<Router>
	<Route path="/email/" component={EmailIndexPage} />
	<Route path="/email/send" component={EmailSendPage} />
	<Route path="/email/:code" component={EmailDetailPage} />
</Router>

// ServiceEmailRoute
<Router>
	<Route path="/statistic/" component={StatisticIndexPage} />
	<Route path="/statistic/year" component={StatisticYearPage} />
	<Route path="/statistic/month" component={StatisticMonthPage} />
</Router>

There may be a redirect to /login inside the pages. Due to toChildArray, it is not visible in nested routers, this leads to bugs.

Sorry for my bad English

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions