SILENT
SILENT

Reputation: 4278

React-Spring causes current page to scroll to the top before transitioning to next page

I am using react-springs to transition from page to page in a NextJS web app.

To reproduce the error:

  1. Open the codesandbox link: https://codesandbox.io/s/nextjs-page-transition-react-spring-ggx7n?file=/pages/_app.js
  2. Navigate to the bottom of live web app
  3. Click the Contacts link

You will notice that the index page scrolls to the top and then transitions to the contact page. I slowed the transition down to reveal it.

How can I prevent it from scrolling to the top of the page before transitioning to the next?

Upvotes: 1

Views: 271

Answers (0)

Related Questions