Skip to content

React Strict Mode doesn't work #57

@leppaott

Description

@leppaott

It seems this doesn't work with React Strict mode:

reactStrictMode: false — the library's useInterceptLinkClicks uses as a one-time guard that never resets in cleanup. Strict Mode's double-invoke leaves the listener detached permanently.

https://github.com/LayerXcom/next-navigation-guard/blob/main/src/hooks/useInterceptLinkClicks.ts#L25

Setting it to false on cleanup seems to work fine as a workaround.

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