fix: prevent card-enter animation double-fire on reload#364
Conversation
The animation was applied via inline style during SSR, causing it to play once when the browser rendered the HTML, then again after React hydration. Now the animation is only enabled after hydration via a mounted state check. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WalkthroughThe changes add an optional Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 Preview DeployedURL: https://wodsmith-app-pr-364.zacjones93.workers.dev
This comment is automatically updated on each push to this PR. |
Summary
card-enteranimation on/competefired twice on page reload — once from SSR HTML, again after React hydration re-applied the inline stylehasMountedstate that gates the animation to only run after hydration, preventing the double-fireTest plan
/compete— cards should animate in onceprefers-reduced-motionstill disables animation🤖 Generated with Claude Code
Summary by cubic
Prevents the
card-enteranimation on/competefrom firing twice on reload by enabling it only after client hydration. Adds ananimateprop toCompetitionCardand gates it with ahasMountedstate;prefers-reduced-motionbehavior is unchanged.Written for commit 689283c. Summary will update on new commits.
Summary by CodeRabbit