Skip to content

chore(Reanimated3): cherry-pick #7269 #7314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 28, 2025

Conversation

tjzel
Copy link
Collaborator

@tjzel tjzel commented Mar 27, 2025

Summary

In current implementation calling cancelAnimation on Web results in an error since it invokes runOnUI.

Test plan

  • Test in in WebExample

## Summary

In current implementation calling `cancelAnimation` on Web results in an
error since it invokes `runOnUI`.

## Test plan

- [x] Test in in WebExample
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR cherry-picks changes from #7269 to address errors on Web when calling cancelAnimation by introducing separate implementations for native and web platforms.

  • Split cancelAnimation into two implementations: cancelAnimationNative for native and cancelAnimationWeb for web
  • Export cancelAnimation as a constant that selects the appropriate implementation based on the platform flag
Comments suppressed due to low confidence (2)

packages/react-native-reanimated/src/animation/util.ts:577

  • Verify that the self-assignment in cancelAnimationWeb reliably cancels the animation on Web; consider adding an inline comment to explain this non-obvious technique.
sharedValue.value = sharedValue.value; // eslint-disable-line no-self-assign

packages/react-native-reanimated/src/animation/util.ts:588

  • [nitpick] Consider renaming the constant 'SHOULD_BE_USE_WEB' to a more descriptive name such as 'isWebPlatform' to clearly indicate its purpose as a platform check.
export const cancelAnimation = SHOULD_BE_USE_WEB

@tjzel tjzel mentioned this pull request Mar 27, 2025
13 tasks
Copy link
Contributor

@patrycjakalinska patrycjakalinska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪨

@tjzel tjzel merged commit e4d043a into 3.17-stable Mar 28, 2025
31 of 40 checks passed
@tjzel tjzel deleted the @tjzel/reanimated3/cherry-pick-#7269 branch March 28, 2025 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants