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-parallax context value. Please ensure the component is wrapped in a <ParallaxProvider>

Steps to Reproduce the Problem

  1. I placed ParallaxProvieder in my _app.js file.
  2. I created my parallax component and it’s working fine!
  3. I created a ParallaxCache component just like the example.
  4. I put ParallaxCache beside 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

Most upvoted comments

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 https://github.com/sebinievas Thanks. There is nothing wrong with your ParallaxProvider. But in the test.js file, I’m not sure about using offsetYMin and offsetYMax props. As I remember and written in documents, you should use like y={[ -10, 10 ]}. For more information, read this section of the document: https://github.com/jscottsmith/react-scroll-parallax#parallax-props

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/jscottsmith/react-scroll-parallax/issues/79#issuecomment-603752428, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC5IRL64W4UHOFUZTGO273RJHJQVANCNFSM4J6RPCFQ .

@sebinievas Thanks. There is nothing wrong with your ParallaxProvider. But in the test.js file, I’m not sure about using offsetYMin and offsetYMax props. As I remember and written in documents, you should use like y={[ -10, 10 ]}. For more information, read this section of the document: https://github.com/jscottsmith/react-scroll-parallax#parallax-props