Skip to content

[Bug]: Location state type any  #10241

@simeng-li

Description

@simeng-li

What version of React Router are you using?

6.9.0

Steps to Reproduce

const { state } = useLocation() throws ts unsafe assignment error.

Expected Behavior

The state type defined in the Location should be unknown.

image

Actual Behavior

The state type defined in Location is any

https://github.com/remix-run/react-router/blob/main/packages/router/history.ts#L60

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions