react-router icon indicating copy to clipboard operation
react-router copied to clipboard

[Docs]: Add state example and state passing infos

Open sbrauch opened this issue 2 years ago • 3 comments

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!

sbrauch avatar May 03 '23 13:05 sbrauch

Shoud i add examples in all hooks or only ones which you've mentioned?

ashusnapx avatar Aug 02 '23 06:08 ashusnapx

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!

sbrauch avatar Aug 02 '23 07:08 sbrauch

Hello there. I have pushed PR https://github.com/remix-run/react-router/pull/11133

boonya avatar Dec 21 '23 17:12 boonya