Skip to content

[FEAT] don’t set hasAnimated.current = true before the animation finishes. #3111

Description

@rudrakshtank

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestgssoc:assignedGSSoC: Issue assigned to a contributorneeds-triageNeeds maintainer triage

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions