0

When I use a simple Link as in:

import {Link} from 'react-router-dom'

<Link
  className="btn btn-primary btn-lg"
  to={'/path'}>
  Learn More
</Link>

the new view opens up at the middle of the page instead of at the top. How can I change that? Thanks.

Chris
  • 57,622
  • 19
  • 111
  • 137
Pete
  • 502
  • 1
  • 6
  • 20

1 Answers1

3

Take a look at Scroll Restoration from the React Router docs.

Mark Rabey
  • 1,375
  • 9
  • 11