wouter
wouter copied to clipboard
Handle Browser Back and Forward Buttons with Custom Page Transition
I have a hook to handle link button clicks. When a link button is clicked, a page transition is shown and animated. After the animation completes, the location is set to the target address.
However, I have a question regarding handling the browser's back and forward buttons. When the back button is clicked, I want to:
Prevent the default event that navigates to the previous page. Set the target address. Animate the page transition. After the animation completes, set the location to the target address. Could you please provide an solution for this?