Skip to content

route.params can return array, but also string #1400

Closed
@719media

Description

@719media

Version

4.0.15

Reproduction link

jsfiddle.net/z6ht9v0w/5/

Steps to reproduce

If you create a route with wildcard, say, /post/:tags*, and then hit the route with /post/a/b/c, the value of route.params.tags will be ['a', 'b', 'c'] inside of the props(route) function.
However, if you navigate to /post, the value of route.params.tags will be empty string ''
I think it would be better to align the return type here and pass an empty array []

What is expected?

Passing an empty array []

What is actually happening?

Passing an empty string ''


There may be a specific reason for the empty string behavior, but I didn't see any issues or commits explaining why.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions