Skip to content

[Bug]: useNavigate's NavigateFunction is mixing async and non-async return types #12348

@kylsgl

Description

@kylsgl

What version of React Router are you using?

7.0.1

Steps to Reproduce

Initialize navigate

const navigate = useNavigate();

Expected Behavior

The navigate function return type should be either:

void

or

Promise<void>

This would make it clear whether we need to handle a promise or not, making the behavior of navigate more predictable.

Actual Behavior

navigate return type is

void | Promise<void>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions