File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ public void removeRootView(int rootViewTag) {
175175 *
176176 * @return The num of root view
177177 */
178- private int getRootViewNum () {
178+ public int getRootViewNum () {
179179 return mOperationsQueue .getNativeViewHierarchyManager ().getRootViewNum ();
180180 }
181181
@@ -608,12 +608,6 @@ public void measureLayoutRelativeToParent(
608608
609609 /** Invoked at the end of the transaction to commit any updates to the node hierarchy. */
610610 public void dispatchViewUpdates (int batchId ) {
611- if (getRootViewNum () <= 0 ) {
612- // If there are no RootViews registered, there will be no View updates to dispatch.
613- // This is a hack to prevent this from being called when Fabric is used everywhere.
614- // This should no longer be necessary in Bridgeless Mode.
615- return ;
616- }
617611 SystraceMessage .beginSection (
618612 Systrace .TRACE_TAG_REACT_JAVA_BRIDGE , "UIImplementation.dispatchViewUpdates" )
619613 .arg ("batchId" , batchId )
Original file line number Diff line number Diff line change @@ -719,7 +719,12 @@ public void onBatchComplete() {
719719 listener .willDispatchViewUpdates (this );
720720 }
721721 try {
722- mUIImplementation .dispatchViewUpdates (batchId );
722+ // If there are no RootViews registered, there will be no View updates to dispatch.
723+ // This is a hack to prevent this from being called when Fabric is used everywhere.
724+ // This should no longer be necessary in Bridgeless Mode.
725+ if (mUIImplementation .getRootViewNum () > 0 ) {
726+ mUIImplementation .dispatchViewUpdates (batchId );
727+ }
723728 } finally {
724729 Systrace .endSection (Systrace .TRACE_TAG_REACT_JAVA_BRIDGE );
725730 }
You can’t perform that action at this time.
0 commit comments