Closed IanBoyte closed 11 months ago
It's a react strict mode thing. If you turn off strict mode in dev then it works fine.
However that being said the code should be resilient to how react 18+ works so ideally the author can update the package to handle strict mode.
This should definitely be fixed in this library, also caused an issue for me in Nextjs 14
try v3.4.3
I now get Error: Could not find react-scroll-parallax
context value. Please ensure the component is wrapped in a
Whenever I save. Even though the wrapper is in the layout file.
I also see this error:
app-index.js:31 Warning: Cannot update a component (`HotReload`) while rendering a different component (`Parallax`). To locate the bad setState() call inside `Parallax`, follow the stack trace as described in https://reactjs.org/link/setstate-in-render
@raRaRa mind creating and sharing a minimal repo reproducing your setup? I'm unable to reproduce these hot reloading errors in my current setup - see repo here
I now get Error: Could not find
react-scroll-parallax
context value. Please ensure the component is wrapped in aWhenever I save. Even though the wrapper is in the layout file.
I upgraded to v3.4.3 and now the context value isn't there, even though I put
Just so you know, I'm using my own container ref.
I am also experiencing the issue:
Error: Could not find react-scroll-parallax
context value. Please ensure the component is wrapped in a
Using Next on version 3.4.3 of this package
If anyone can share a minimal repo that reproduces this error and clear steps to take for reproduction, that would be more helpful.
To reproduce, try editing page.tsx
and adding <AnimatedDiv />
's or editing page.tsx
in general. You should see that error come up. This also shows the issue with parallax effect just working initially, and then it stops. Maybe you can figure out what's going on, but I have a feeling that the library is not handling cases with strict mode, e.g. calling useEffects twice.
I have a PR that should fix these issues: https://github.com/jscottsmith/react-scroll-parallax/pull/234
Please try v3.4.4 to see if this issue is resolved.
This issue appears to be resolved for me, running "react-scroll-parallax": "^3.4.4" and "next": "^14.0.3".
This issue appears to be resolved for me, running "react-scroll-parallax": "^3.4.4" and "next": "^14.0.3".
Same here, resolved using: "^3.4.4" and "next": "^14.0.3".
Running locally, whenever a live reload occurs, ex. after updating a css module file, the following error occurs:
The following is our implementation of the ParallaxProvider:
"next": "13.4.9", (downgraded due to issue seen here) "react": "18.2.0", "react-dom": "18.2.0", "react-intersection-observer": "^9.5.2", "react-scroll-parallax": "^3.4.2",