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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix] calling navigate with number throws #506

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

baptooo
Copy link

@baptooo baptooo commented Apr 25, 2022

Hello, first thank you for the wonderful job I am using reach router for more than a year now and I am super happy with it ! 馃憦

I am raising this pull request as I faced an issue using navigate function with a number

The issue

When calling the function navigate with a number as it is mentioned in the documentation

You can pass a number to go to a previously visited route.
navigate(-1)

It results into a crash because the function startsWith requires a string and is called with to argument

reach-router-exception-navigate-number

The fix

Escaping the case where to argument is a number

- the function `startsWith` was called in any case and was causing an exception to throw when passing `number`
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

Successfully merging this pull request may close these issues.

None yet

1 participant