mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Create tryDispatchMountItems runnable only when needed (#53196)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53196 In the FabricUIManager, the runnable created for scheduled mounts is only used if currently running on the UI thread. With this diff the runnable only gets created when needed. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D79969412 fbshipit-source-id: ee78890322af8580357389aad8357f7c0d18490f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6738dbcc7e
commit
cc71f9c550
+7
-7
@@ -935,14 +935,14 @@ public class FabricUIManager
|
||||
if (shouldSchedule) {
|
||||
Assertions.assertNotNull(mountItem, "MountItem is null");
|
||||
mMountItemDispatcher.addMountItem(mountItem);
|
||||
Runnable runnable =
|
||||
new GuardedRunnable(mReactApplicationContext) {
|
||||
@Override
|
||||
public void runGuarded() {
|
||||
mMountItemDispatcher.tryDispatchMountItems();
|
||||
}
|
||||
};
|
||||
if (UiThreadUtil.isOnUiThread()) {
|
||||
Runnable runnable =
|
||||
new GuardedRunnable(mReactApplicationContext) {
|
||||
@Override
|
||||
public void runGuarded() {
|
||||
mMountItemDispatcher.tryDispatchMountItems();
|
||||
}
|
||||
};
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user