Skip to content

[Bug]: react-router v7 overrides Navigator causing type errors #12385

Closed
@enjikaka

Description

@enjikaka

What version of React Router are you using?

7

Steps to Reproduce

Use navigator API somewhere in your code.

Expected Behavior

The browser native types are working.

Actual Behavior

Types do not work, Navigator types are overriden by react-router. In v6 there were no clashing types. Do not override global types!

The code causing this:

declare global {
interface Navigator {
connection?: { saveData: boolean };
}
}

Screenshots:

Skärmavbild 2024-11-25 kl  11 35 03 Skärmavbild 2024-11-25 kl  11 35 09

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