javascript - React-router need a way to detect route change -
i search way detect route change / leave. try exemple https://github.com/rackt/react-router/blob/master/docs/guides/advanced/confirmingnavigation.md can't make work in project.
i need next route too, route argument onleave
doesn't provide anything.
i know can detect url document.location
in onleave function, want more consistant or built in.
does can me this?
thank you
the route leave hook indeed called next location, when transition triggered react router.
if you're leaving page outright, you're not going see this, because hitting "before unload" hook, router can't build next location, since it's not router managing.
Comments
Post a Comment