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.86k stars 158 forks source link

It always run onEnter at the beginning. #204

Closed CuongGuti closed 1 year ago

CuongGuti commented 1 year ago

Bug

It always run onEnter at the beginning. Can you check please. Thank you.

Example:

useParallax({ translateX: ['-50%', '0%'], opacity: [0, 2], onEnter: () => { // always run this when init or page load.... please help me to fix. }, speed: 0, }),

jscottsmith commented 1 year ago

Happy to help but I'll need a Codesandbox that reproduces the bug.

Fork this sandbox and demo the bug please:

https://codesandbox.io/s/react-scroll-parallax-template-x6lus4