On the problem of the buried point of the flow direction of the page

problem description

now we have made a webapp, technology stack, such as react+antd-mobile+react-router4, etc., and now we need to record the previous page and the next page of each page jump, stay time, and so on.
it"s not a big problem to think about it if you write it separately in each component, but the workload is heavy and it"s not easy to maintain
. So I want to write a global method. The current idea is to record it when route loads, but now I can"t get the address of the previous page

. Is there any better way to achieve him?


listening to history, makes sense


1.react-router,react-reduxstore
2.jsdocument.referrer
3.vue,vue-routerbeforeRouteEntervue()

Menu