react-router
react-router copied to clipboard
nested Redirect throws error
Having a Redirect in my routes setup like this:
<Route name="accounts" handler={Accounts}>
<Route path=":account" name="account" handler={Account}>
<Route name="profile" handler={Profile} />
<Redirect path="/accounts/:account" to="profile" />
</Route>
</Route>
react-router throws this error in version >= 0.12.1:
Error: Invariant Violation: You cannot nest path "/accounts/:account" inside "/accounts/:account
There is no error using version 0.12.0 though. Is this a bug or did you change the API?
Not sure if that's intentional or not.
Your scenario looks a lot like the one in #883 though.
yep, I just do this https://github.com/rackt/react-router/issues/883#issuecomment-76299927
I would merge a <DefaultRedirect/> though.