i'm trying to set message on redirect
<Redirect from="*" to="/error" onEnter={() => MyStore.addError(new Error("Page Not Found"))}/>
this says Warning: <Redirect> should not have a "onEnter" prop
so i'm trying to do like so
<Route path="/" component={App}>
...
<Route path="error" component={Error}>
<Route path="*" component={Dummy} onEnter={() => MyStore.addError(new Error("Page Not Found"))}>
<Redirect from="*" to="/error"/>
</Route>
</Route>
but this doesn't work either
do i really need to implement separate component for PageNotFound error rather than reuse my common Error component?
Thanks for your question!
We want to make sure that the GitHub issue tracker remains the best place to track bug reports and feature requests that affect the development of React Router.
Questions like yours deserve a purpose-built Q&A forum. Could you post this question to Stack Overflow with the tag #react-router? https://stackoverflow.com/questions/ask?tags=react-router.
We also have an active and helpful React Router community on Reactiflux, which is a great place to get fast help with React Router and with the rest of the React ecosystem. You can join at https://discord.gg/0ZcbPKXt5bYaNQ46.
thanks for your answer, it was really helpful.
i guess you misunderstood me, its not a question
i'm asking you to implement feature
there is
<Route path="*" ...>
and i'm asking you to implement
<Redirect path="*" ...>
this should not be very difficult