javascript - Retrieve back navigation action from react router -


in application i'm building chose react-router handle navigation flow, need track event of navigating on browser, when try load component in new render need know if user has landed here pressing button. best way track it? i'm pretty sure using history api, couldn't find straight way check that, , feels should pretty easy given how library works.

anyone shed light on matter welcomed! thanks!

you're correct! react-router uses html5 history api, explained in docs here (https://github.com/rackt/react-router/blob/master/docs/api.md#histories) you'll need import 'browser history' package , pass router, documented here (https://github.com/rackt/react-router/blob/master/docs/guides/basics/histories.md#browserhistory).

there example in doc's how go implementing here (https://github.com/rackt/react-router/blob/master/docs/guides/basics/histories.md#example-implementation)


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -