Open masakudamatsu opened 4 years ago
How to detect the back button click and the forward button click: https://stackoverflow.com/a/60125216/11847654
A possible solution
Use document.onreadystatechange = () => {}
to detect the loading of a page
document.readyState
objectDetect whether page is loading after the browser's back/forward button click
Use the array of history
to check whether the previous page is to the left or to the right
Overwrite the page transition animation class name on TransitionGroup
component
A day of investigation reveals:
document.onreadystatechange = () => {}
, we can use React.useEffect()
to detect the loading of a page.
Problem
Ideal solution