Skip to content

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

Baptiste Rios Campo added 2 commits April 25, 2022 14:21
- 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.

1 participant