Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flush operations for events on iOS Fabric (software-mansion#4110)
## Summary This PR fixes issue with UI not updating when style changes are connected to events on iOS Fabric. This problem has been introduced in software-mansion#3970 where we migrated from using `rAF` and started using `setImmediate` instead. As a result we had to manually flush set-immediates queue in certain conditions. Specifically this was already happening after animations frame was run (i.e. in `requestAnimationFrame` callback) but should also be done directly after handling events much like we already do on Android [here](https://github.com/software-mansion/react-native-reanimated/blob/99b8b3ed56e36ca615cce7164ccaf04d154571b1/android/src/main/java/com/swmansion/reanimated/NodesManager.java#L283) and on iOS-paper [here](https://github.com/software-mansion/react-native-reanimated/blob/d9a55c556fc32fcb5db59acc92cbedd6452af9dc/ios/REANodesManager.mm#L334). The reason this stopped working on iOS and not on Android was that Android-fabric implementation still uses old architecture flow for handling events while iOS uses new C++ based `react::EventListener` API (that apparently wasn't working on Android last time we checked). This PR adds flushing operations queue in that new C++ based flow. Note that this problem didn't occur before Shareable Rewrite (software-mansion#3722) because before all mapper updates would result in us scheduling new animation frames. So the updates were happening eventually, were just delayed by one frame. ## Test plan Run Fabric example on iOS, test Article progress example.
- Loading branch information