jscottsmith / react-scroll-parallax

🔮 React hooks and components to create parallax scroll effects for banners, images or any other DOM elements.
https://react-scroll-parallax.damnthat.tv/
MIT License
2.9k stars 158 forks source link

What's not described in documentation. #109

Closed ghost closed 3 years ago

ghost commented 3 years ago

SMALLER QUESTIONS:

What are the left and right or first and second values of the x and y array props for Parallax stand for?

BIGGEST QUESTIONS:

What "Element" does the Providers scrollContainer prop take? A ref or a className of your overflow container?

Does this work with redux or only with contextAPI, there are many libraries that only work with a specific State tool.

If your scroll container is in a child component but you wrap your top-level component in the provider, do you have to save a ref up to the global state?

jscottsmith commented 3 years ago

What are the left and right or first and second values of the x and y array props for Parallax stand for?

First value is the start offset as the element enters the view, second is ending offset as the element leaves the view.

What "Element" does the Providers scrollContainer prop take? A ref or a className of your overflow container?

HTML Element

Does this work with redux or only with contextAPI, there are many libraries that only work with a specific State tool.

Works with the context api that is shipped with React.

If your scroll container is in a child component but you wrap your top-level component in the provider, do you have to save a ref up to the global state?

Use a component as the scroll container, something like https://github.com/jscottsmith/react-scroll-parallax/blob/develop/stories/ScrollContainer.js