Skip to content

Sync settled props when app resumes#9588

Open
sorinc03 wants to merge 1 commit into
software-mansion:mainfrom
sorinc03:fix/settled-props-app-resume
Open

Sync settled props when app resumes#9588
sorinc03 wants to merge 1 commit into
software-mansion:mainfrom
sorinc03:fix/settled-props-app-resume

Conversation

@sorinc03

@sorinc03 sorinc03 commented Jun 2, 2026

Copy link
Copy Markdown

Summary

Fixes #9574.

FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS syncs completed animated props back into React on a polling interval. On Android, a press-driven Linking.openURL can pause the app before the next polling tick, leaving React state behind the final native animated value until the app resumes.

This registers an AppState listener while the settled-props collector is active and triggers an immediate sync when the app becomes active, so React catches up as soon as the app returns instead of waiting for the next interval tick.

Test plan

Added a Jest regression test for the app-resume sync:

yarn workspace react-native-reanimated test PropsRegistryGarbageCollector.test.ts --runInBand
yarn eslint packages/react-native-reanimated/src/PropsRegistryGarbageCollector.ts packages/react-native-reanimated/__tests__/PropsRegistryGarbageCollector.test.ts

I also smoke-tested the linked Android repro on an API 35 emulator:

git clone https://github.com/lujjjh/reanimated-settled-props-repro
pnpm install
pnpm exec expo prebuild --platform android --clean
pnpm android

I ran the press-driven flow from #9574 repeatedly on the published 4.4.0 package and on this branch wired through file:../react-native-reanimated/packages/react-native-reanimated. The issue did not reproduce in this emulator run, but the patched build compiled, installed, launched, and kept the modal open through 8 browser-return loops with the same modal bounds after returning.

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.

Android: FORCE_REACT_RENDER_FOR_SETTLED_ANIMATIONS can commit stale animated props after app resume

1 participant