malerba118 / scrollex

Build beautiful scroll experiences using minimal code

Home Page:https://scrollex-docs.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

useVelocity error in scrollex

thatFemicode opened this issue · comments

@malerba118 can you kindly take a look at this error, I know it is the holidays but I noticed this error and I think I found where it I coming from which is this customhook
this is the error Cannot read properties of undefined (reading 'add')
this is the custom ohook in scrolled package
function useVelocity(value) {
const velocity = useConst(() => framerMotion.motionValue(value.getVelocity()));
React.useEffect(() => {
return value.velocityUpdateSubscribers.add((newVelocity) => {
velocity.set(newVelocity);
});
}, [value]);
return velocity;
}

For sure, have had a few bugs reported in the last week or two and my plan is to dig into them this weekend or even this week if i find the time 👍

Seems like some api's have changed in the most recent version of framer-motion and velocityUpdateSubscribers is no longer exposed.

framer/motion@44744e0#diff-ce757db9ed559677ef9642e7b04897ee154ff83d64242842fdd0b70f8d2bc8a7

Until i get this fix published you could bump down framer-motion a version or two and i think that will fix it temporarily.

Published a version with a fix! v2.0.1

okay thanks will check this out now