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

Adding 0 as a parameter doesn't show up in <Link> #72

Closed
TimDaub opened this issue Feb 21, 2019 · 2 comments · Fixed by #75
Closed

Adding 0 as a parameter doesn't show up in <Link> #72

TimDaub opened this issue Feb 21, 2019 · 2 comments · Fixed by #75

Comments

@TimDaub
Copy link

TimDaub commented Feb 21, 2019

Sorry for this slightly confusing headline.

I have:

                       <Link
                            view={views.pay}
                            params={{
                                id: vuln.id
                            }}
                            store={this.props.store}>
                            Pay
                        </Link>

Where vuln.id is 0 of type integer. However when it's 0, mobx-router's Link is not including it into the URL "http://localhost:3000/pay/", while when I call vuln.id.toString() it does.

@thdk
Copy link
Collaborator

thdk commented Feb 28, 2019

Likely to be related to #46

thdk added a commit to thdk/mobx-router that referenced this issue Mar 2, 2019
@thdk
Copy link
Collaborator

thdk commented Mar 2, 2019

I've tested this locally and found out that when you pass a zero to any property of the params object, it won't be displayed in the url but it will be available in the params object in 'onbeforeenter' and its also available as store.router.params.id.

However, it does make sense to display '0' in the url so I've made the changes suggested in #46 and created a PR for this.

@kitze kitze closed this as completed in #75 Mar 5, 2019
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 a pull request may close this issue.

2 participants