Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Scroll is broken for newer versions of NextJs > 13.5 #567

Open
JonnyDeates opened this issue Nov 1, 2023 · 5 comments
Open

React Scroll is broken for newer versions of NextJs > 13.5 #567

JonnyDeates opened this issue Nov 1, 2023 · 5 comments

Comments

@JonnyDeates
Copy link

After Nextjs updated to version 13.5 and above react scroll no longer works. They changed how importing works in their system, not sure if it has anything to do here on y'all's side of things, but just want to make sure people are able to track the breaking change from this. vercel/next.js#55794

@fisshy
Copy link
Owner

fisshy commented Nov 1, 2023

Great catch, seems like there's no workaround atm?

If you find a solution let us know, or just submit a PR.

@fisshy
Copy link
Owner

fisshy commented Nov 1, 2023

Ok, I just tried react-scroll on next.js v14.0.1.

It works great for me, only change needed is to use "use client"

I also added a next.js example.
https://github.com/fisshy/react-scroll/blob/master/examples/next-js/page.tsx

@willTastyMakers
Copy link

Hi Fisshy,
In the solution above, you are not using Link's "onSetActive()" method. Have you had any success getting scrollSpy to work when Element associated with. link becomes active?

@ozkanparlakkilic
Copy link

ozkanparlakkilic commented Jan 2, 2024

Fisshi's suggestion worked in my project too.

Next JS version: 14.0.4
react-scroll version: 1.9.0

@JonnyDeates
Copy link
Author

Apologies, I am using react-scroll-parallax, not react-scroll. The fix of "use client" on the component doesn't work. :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants