jscottsmith / react-scroll-parallax

🔮 React hooks and components to create parallax scroll effects for banners, images or any other DOM elements.

Home Page:https://react-scroll-parallax.damnthat.tv/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow users to disable parallax from ParallaxProvider

ArthurSangouard opened this issue · comments

I'm looking to disable parallax on mobile, but it seems that the way to do this is to toggle the disabled prop in every instance of useParallax or Parallax.
Letting users enable it from the root ParallaxProvider component would greatly simplify this.

That would also be helpful for accessibility for users who prefers-reduced-motion

Yep this is a great idea. I'll look into it as soon as I can.

Better late than never ;-)

Use the isDisabled prop.

<ParallaxProvider isDisabled>...</ParallaxProvider>

If there's any issues, let me know.