Skip to content

Issue with useParams hook on unmounted component #6938

@brandon-pereira

Description

@brandon-pereira

Version

5.1.0

Test Case

https://codesandbox.io/s/jolly-field-rm0sb

Steps to reproduce

Use the children prop on a <Route /> to render a component.

Expected Behavior

Like with accessing match off of props, useParams() should return null or an empty object.

Actual Behavior

useParams errors when reading property off null.

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