/react-router-scroll-top

An example React app started from create-react-app that illustrates how you can create a route that restores scroll on route change with react-router v4.

Primary LanguageJavaScript

Repo to support an answer for this question on stackoverflow.

A good explanation of the code can be found in the answer.

Setup

It's a create-react-app, so for more details check that out.

To run it, do this steps:

  1. npm install
  2. npm run start

The app will run on port 3000.