react-router
react-router copied to clipboard
[Docs]: Add state example and state passing infos
Describe what's incorrect/missing in the documentation
Page: https://reactrouter.com/en/main/hooks/use-navigate
1/ Would it be possible to add a state example here like: { state: { redirect: true } }?
2/ Would it be possible to mention here and in the useLocation information how to access the state in the other file, like:
const location = useLocation();
location.state.redirect
That would be very helpful :) Thanks!
Shoud i add examples in all hooks or only ones which you've mentioned?
I was just using this one and I saw that the example was missing :) If you can, it would be good to have an example in all hooks, indeed. Thanks!
Hello there. I have pushed PR https://github.com/remix-run/react-router/pull/11133