framer-motion-hooks
framer-motion-hooks copied to clipboard
Scroll jump using useInViewScroll
I am using this hook to create a parallax effect in an image and when the component is mounted there is a jump in the image the first time the scroll is executed, the strange thing is that the jump only happens if the scroll position does not start at 0 , It is the first time that I use useTransform so I do not know if it will be my error
Example => https://codesandbox.io/s/framer-motion-parallax-img-nb6h2?file=/src/App.js:202-252
Thank you for reporting. This was a bug in the package's internal implementation and got fixed in the latest commit.
You can now safely upgrade to the latest version [email protected]
.
Let me know if this resolved your issue.
Hi , I already updated to the new version but the jump continues to occur, I am adding the reference to the image I don't know if the problem is that when the values of the image are calculated it is not loaded yet, maybe trying to use useLayoutEffect when the values are calculated ?
What happens if you hardcode the image's dimensions in advance?
I tried but it didn't work