react-scroll-parallax: Using with Next.js and gives an error for ParallaxProvieder when using useController()
Expected Behavior
Able to use useController() in my next.js app.
Actual Behavior
It throws an error that:
Error: Could not find
react-scroll-parallaxcontext value. Please ensure the component is wrapped in a<ParallaxProvider>
Steps to Reproduce the Problem
- I placed
ParallaxProviederin my_app.jsfile. - I created my parallax component and it’s working fine!
- I created a
ParallaxCachecomponent just like the example. - I put
ParallaxCachebeside my parallax component and it gives me the error.
Environment
- Next version: 9.0.5
- Browser: chrome last update
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (5 by maintainers)
Commits related to this issue
- set current scroll on updates #79 #65 — committed to jscottsmith/react-scroll-parallax by jscottsmith 3 years ago
How can I make the useController() hook work with Next.JS if it’s server-side generated?
@jscottsmith Fixed, thanks, now it works out of the box for my Next.js app.
Thank you! I think this is working. I created a brand new project just to test this out, and it seems to be working! I must have pulled an OLD example? Sigh… glad its working!
On Wed, Mar 25, 2020 at 3:06 AM Hossein Rahimi notifications@github.com wrote:
@sebinievas Thanks. There is nothing wrong with your
ParallaxProvider. But in thetest.jsfile, I’m not sure about usingoffsetYMinandoffsetYMaxprops. As I remember and written in documents, you should use likey={[ -10, 10 ]}. For more information, read this section of the document: https://github.com/jscottsmith/react-scroll-parallax#parallax-props