Problem Statement
In React Strict Mode during development, effects can run, clean up, then run again. Since your code sets hasAnimated.current = true immediately, the second run may skip the animation and jump straight to the target.
Proposed Solution
Update the hook so that hasAnimated.current is set to true only after the animation finishes, not before it starts. This prevents the animation from being skipped in React Strict Mode during development.
Feature Area
Landing Page
Alternatives Considered
No response
Acceptance Criteria
Additional Context
No response
Problem Statement
In React Strict Mode during development, effects can run, clean up, then run again. Since your code sets
hasAnimated.current = trueimmediately, the second run may skip the animation and jump straight to the target.Proposed Solution
Update the hook so that
hasAnimated.currentis set to true only after the animation finishes, not before it starts. This prevents the animation from being skipped in React Strict Mode during development.Feature Area
Landing Page
Alternatives Considered
No response
Acceptance Criteria
Additional Context
No response