Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

props version of navigate do not support number in to param #470

Open
raplemie opened this issue May 14, 2021 · 0 comments
Open

props version of navigate do not support number in to param #470

raplemie opened this issue May 14, 2021 · 0 comments

Comments

@raplemie
Copy link

Issue

I tried to use the route props version of the navigate function as suggested in the documentation and it crashes when used with a -1 value (or any number).

https://reach.tech/router/api/navigate

Or better, yet, use props.navigate passed to your route components and then you can navigate to relative paths...

Code Sandbox

  1. Boil down your issue on codesandbox (https://codesandbox.io/s/lplnp60wnm).

Changed react and @reach/router dependencies, not sure what default 0.0.0-rc2 is, but it was not supporting the useNavigate for comparison.

The "Home" route is using the useNavigate hook to get the navigate function, which works well.
The "Dashboard" route is using the navigate from recieved props and cause a crash in the resolve as it expects a string.
https://codesandbox.io/s/reach-router-starter-v1-forked-8m4e9?file=/src/index.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant