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

Route parameter set to 0 (zero) is ignored #721

Open
williamtetlow opened this issue Aug 14, 2017 · 1 comment
Open

Route parameter set to 0 (zero) is ignored #721

williamtetlow opened this issue Aug 14, 2017 · 1 comment

Comments

@williamtetlow
Copy link

williamtetlow commented Aug 14, 2017

Steps to reproduce.

  1. Define route with parameter
FlowRouter.route('/example-route/:routeParam', {
  name: 'exampleRoute',
  action() {
    // Some action...
  },
});
  1. Attempt to go to route with routeParameter set to 0

FlowRouter.go('exampleRoute', { routeParam: 0 });

The value 0 for routeParam is ignored.

Guessing a generic is null/undefined check against the param will be causing this
(i.e. if (routeParam) { do something })

Workaround is set to parameter as { routeParam: '0' }. However, this is counter intuitive when all other integers work as route parameters.

I can submit PR with fix if this is a feature you wish to include.

@Wicloz
Copy link

Wicloz commented May 4, 2019

Just letting you know a fix for this would be appreciated as it it still an existing issue.

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

2 participants