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

Document params must be strings, numbers, or arrays of these (for repeated params) in programmatic navigation #873

Closed
laurikihva opened this issue Apr 9, 2021 · 2 comments
Labels
docs Concerns the documentation content or the documentation website

Comments

@laurikihva
Copy link

Version

4.0.6

Reproduction link

https://codesandbox.io/s/dawn-pine-4yc98

Steps to reproduce

  1. Press button on Home page which routes to About page with undefined id param.
  2. Undefined id param is included in the URL & passed to About page as string

What is expected?

Undefined params are not passed to URL & on the redirected page this param value should also be undefined

What is actually happening?

Undefined is passed to the URL & is usable on the destination page as a string


Also happens if id is passed as null.

Doesn't matter if param is optional or not:

  • path: "about/:id"
  • path: "about/:id?
@posva
Copy link
Member

posva commented Apr 9, 2021

Duplicate of #855

@posva posva marked this as a duplicate of #855 Apr 9, 2021
@posva
Copy link
Member

posva commented Apr 9, 2021

Since this came up multiple times, I think we should say in the documentation that params must be strings

@posva posva added the docs Concerns the documentation content or the documentation website label Apr 9, 2021
@posva posva changed the title Undefined params included in the url Document params must be strings, numbers, or arrays of these (for repeated params) in programmatic navigation Apr 9, 2021
@posva posva closed this as completed in 0c91292 Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Concerns the documentation content or the documentation website
Projects
None yet
2 participants