Skip to content

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

Closed
@soyersoyer

Description

@soyersoyer

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[]>'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypescriptTypescript related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions