Skip to content

[v6] Adding useHistory hook #7476

@asterikx

Description

@asterikx

I think the history object should be exposed in some way (also for backward-compatibility reasons).

My use case requires to listen to navigation changes before they happen (I have toast messages on my page that I need to dismiss before navigating to another route. Dismissing them after navigating to another route does not work as I might be dismissing toast messages on the page that I'm navigating to as well.)

history.listen seems to fit my use case (see here), but unfortunately, history cannot be accessed in v6.

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