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

fix(TS): update type of Route.name #3117

Merged
merged 2 commits into from
Feb 7, 2020
Merged

fix(TS): update type of Route.name #3117

merged 2 commits into from
Feb 7, 2020

Conversation

rijkvanzanten
Copy link
Contributor

On very first load, name is null, not string or undefined. This means that either the passed route is wrong, or the type is incorrect.

On very first load, `name` is `null`, not `string` or `undefined`. This means that either the passed route is wrong, or the type is incorrect.
@rijkvanzanten rijkvanzanten changed the title Update type of Route.name (TS) fix(TS): update type of Route.name Feb 6, 2020
Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, only the initial location has a name of null

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot, can you fix the failing test?

@rijkvanzanten
Copy link
Contributor Author

Jumped into it too hastily before.. it's fixed now @posva 🙂

@posva posva merged commit 8f831f2 into vuejs:dev Feb 7, 2020
@posva
Copy link
Member

posva commented Feb 7, 2020

Thanks!

@zhuwenqi001
Copy link

after route allows name to be null, there will be such a problem in my project:
router.push and next method error. Do other interfaces also need to be modified? Such as Routeconfig and Location
15_37_58__03_06_2020
2

@LinusBorg
Copy link
Member

Appearantly so. Please open a new issue about this.

@posva
Copy link
Member

posva commented Mar 6, 2020

@zhuwenqi001 see #3139
In your case you can do tab.name! because you know that the name exists. I'm thinking that allowing null for Location shouldn't introduce any problem, so we could maybe allow it for convenience

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.

4 participants