v0.2.0: correctness fixes + reanimated v4 compatibility#2
Draft
mayrang wants to merge 25 commits into
Draft
Conversation
Move inline mock from use-animation.test.ts into __tests__/__mocks__/reanimated.ts. Extend mock to cover withDelay, withSequence, withRepeat, cancelAnimation with synchronous callback invocation. Add testPathIgnorePatterns to jest.config.js to prevent Jest from treating the mock file as a test suite.
…ate Keyframe.delay
Owner
Author
|
Bumped to
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Five correctness fixes in
useAnimationand Reanimated v4 compatibility, while keeping the declarative API surface intact.Correctness fixes
animationsno longer re-runs on parent re-render. The hook now holdsanimationsin a ref; the effect depends only ontriggerandanimateOnMount.onCompleteis driven by Reanimated's UI-thread callback instead of a JSsetTimeout, eliminating drift under JS load.enter/exitconfig selection deep-merges with the base config —enter: { config: { damping: 20 } }no longer clobbersbaseConfig.config.stiffness.mergeOverrides(used byusePresetAnimationoverrides) got the same deep-merge fix.pause()→stop()rename.pause()is preserved as a deprecated alias with a one-time warning.Reanimated v4 compatibility
^3.0.0 || ^4.0.0.SpringConfig.energyThresholdadded;restDisplacementThreshold/restSpeedThresholdmarked@deprecated.runOnJSfunneled throughsrc/internal/schedule.tsfor a future one-line migration toreact-native-worklets.Other
Keyframe.delaymarked@deprecated(was never honored at runtime).CHANGELOG.mdadded (Keep a Changelog format).__tests__/__mocks__/reanimated.ts.Design spec: `docs/superpowers/specs/2026-05-26-v0.2.0-design.md`
Implementation plan: `docs/superpowers/plans/2026-05-26-v0.2.0-implementation.md`
Test Plan