Closed mattoni closed 2 years ago
Ya sounds like a bug but I'll need an example to know for sure.
Some questions to help me reproduce this:
Are you using the useParallax
hook? Or are we talking about the ParallaxBanner
component? Can you share the relevant code blocks please?
Are you using Next JS/Gatsby SSR?
It fails with both the <Parallax />
component and the useParallax
hook. Basically, I'm doing this:
const px = useParallax<HTMLDivElement>({
speed: 50,
disabled: scrollDisabled,
});
and I set scrollDisabled
to true on the client, in a useEffect, once the screen width has been determined.
I'm using Remix, but I imagine it'd be the same for NextJS/Gatsby.
Great, thanks, I'll look into it!
@mattoni please try updating to version v3.0.6
and let me know if the issue is resolved. Thanks!
Perfect, this worked. Thanks so much @jscottsmith !
Hi there!
I'm unable to disable the effect after it's been initialized. The use case is that I am using SSR, but need to disable the effect on mobile due to performance. If I try to change the disabled property on the effect after the client is rehydrated, nothing happens and the effect still occurs. My expectation would be that it would be switched off. If this is not the proper way to do that, how would I go about properly disabling the effect?
Thanks!