Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RN: Enable
useInsertionEffectsForAnimations
(#47595)
Summary: Pull Request resolved: #47595 Enables the `useInsertionEffectsForAnimations` feature flag by default. This changes `useAnimatedProps` to enqueue updates to the `AnimatedNode` graph in `useInsertionEffect` instead of `useLayoutEffect`. The main motivation for `useInsertionEffect` is to avoid unmounting `AnimatedNode` graphs when an `Activity` subtree becomes hidden. Both `useInsertionEffect` and `useLayoutEffect` occur during the commit phase. Although they occur at different moments in the commit phase, the different is difficult to observe and unlikely to impact product code. One observable impact is that with `useInsertionEffect`, animations can now be started from layout effects. Changelog: [General][Changed] - The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects. Reviewed By: mdvacca Differential Revision: D65906157 fbshipit-source-id: d09b2f1b76079eecafbed8c6f5d8ee4695a1f81c
- Loading branch information