Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
synchronise dispatching of view commands through RuntimeScheduler (#4…
…7604) Summary: ## Changelog: [iOS] [Fixed] - Fixed use of view commands from layout effects Mounting of views is delayed by runtime scheduler to allow React to run layout effects. Execution of view commands must by queued together with mounting of views, otherwise it might be executed before views are mounted. When this happens, view commands are ignored. So before, if view command was executed from layout effect (or ref function), it would get dispatched to the UI thread as quickly as possible. But mounting of views would be delayed. To fix this, both mounting of views and view commands are put on the same queue inside of RuntimeScheduler. ## What about Android? Android employs a [retry mechanism](https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/MountItemDispatcher.java#L211) that was needed for react tag based view commands. In paper, one could send a view command to a react tag which was completely disconnected from whether a view exists or not. iOS was built with ref commands in mind, so it doesn't have this mechanism. Fixes: #47576 Reviewed By: javache, cipolleschi Differential Revision: D65909191
- Loading branch information