November 2017
Beginner to intermediate
398 pages
8h 42m
English
The history mode of the router allows us to manage the page scrolling when a route changes. We can reset the position to the top every time, or restore the position the user was in before changing the route (this is very useful when they go back in the browser).
When creating the router instance, we can pass a scrollBehavior function that will get three arguments:
The scrollBehavior function expects an object that can take two different forms. The first is the coordinate of the scroll we ...
Read now
Unlock full access