Skip to content

Typescript: Location interface typing for query should include null #2605

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Labels
Typescript Typescript related issues

Comments

@soyersoyer
Copy link

soyersoyer commented Feb 5, 2019

Version

3.0.2

Reproduction link

https://router.vuejs.org/guide/essentials/navigation.html

Steps to reproduce

When programmatically navigating on vue router, pass through a dictionary with a param as null. E.g.

{
  "foo": null
}

What is expected?

Types are expected to work.
The url should be ?foo.

What is actually happening?

It works, but with an error:

Type '{ foo: null; }' is not assignable to type 'Dictionary<string | string[]>'.

@posva posva added the Typescript Typescript related issues label Feb 5, 2019
@posva posva closed this as completed in ca30a75 Feb 5, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment