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
  • 53,920
  • 18
  • 108
  • 124
Pete
  • 492
  • 1
  • 6
  • 19

1 Answers1

2

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

Mark Rabey
  • 1,275
  • 8
  • 10