Commit 7d85522
Perform AnimationEndSync commits on the React revision (#57493)
Summary:
Pull Request resolved: #57493
Changelog: [General][Fixed] Perform AnimationEndSync commits on the React revision
```
AB Merge
UI thread -----------*----------*------------
JS thread ---*------------*------------------
React abFlush
```
In this scenario:
- AB - Animation Backend update
- React - React commit
- Merge - Merge commit
- abFlush - Animation Backend [flush](https://www.internalfb.com/code/fbsource/[aecb908843884d2fe57e866611a468e47b36518b]/xplat/js/react-native-github/packages/react-native/ReactCommon/react/renderer/animationbackend/AnimationBackend.cpp?lines=242-268)
1. React revision captures the currently mounted main revision and applies the update on top of it. The result becomes the new `reactRevision`.
2. Animation Backend performs updates on the mounted tree, and requests a flush
3. The flush runs on the JS thread, clearing the `animatedPropsRegistry`
4. Merge commit runs, mounting the `reactRevision` and effectively dropping the updates.
This diff changes the flush to happen on the react revision instead, preventing this from happening.
Reviewed By: zeyap
Differential Revision: D111219420
fbshipit-source-id: 6494e8347c1cc6d45ad8cb2f7ad88c6ab076b0e31 parent a016e94 commit 7d85522
2 files changed
Lines changed: 4 additions & 2 deletions
File tree
- packages/react-native/ReactCommon/react/renderer/mounting
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
347 | 347 | | |
348 | 348 | | |
349 | 349 | | |
350 | | - | |
| 350 | + | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
0 commit comments