Framer Motion animation bug traced to unstable object references in shared helper
A developer building Entiscore, a website audit tool, encountered a recurring animation bug where UI sections powered by Framer Motion's whileInView got stuck in a half-rendered, blurred state. The same failure appeared three separate times across different components — the hero title, feature cards, and an evaluation section — each seemingly an isolated issue. The root cause turned out to be a shared helper function, getVariants, that was called inline on every render, generating a new object reference each time even when values were unchanged. Because Framer Motion tracks variants by reference rather than deep equality, and the animations used viewport once:true, any re-render mid-transition caused the animation state and variants object to fall out of sync with no way to self-correct. The fix was to replace the inline helper calls with stable, module-level constant objects, ensuring Framer Motion always received the same reference across renders.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in