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 @@ -177,7 +177,7 @@ public void removeRootView(int rootViewTag) {
177177 *
178178 * @return The num of root view
179179 */
180- private int getRootViewNum () {
180+ public int getRootViewNum () {
181181 return mOperationsQueue .getNativeViewHierarchyManager ().getRootViewNum ();
182182 }
183183
@@ -610,12 +610,6 @@ public void measureLayoutRelativeToParent(
610610
611611 /** Invoked at the end of the transaction to commit any updates to the node hierarchy. */
612612 public void dispatchViewUpdates (int batchId ) {
613- if (getRootViewNum () <= 0 ) {
614- // If there are no RootViews registered, there will be no View updates to dispatch.
615- // This is a hack to prevent this from being called when Fabric is used everywhere.
616- // This should no longer be necessary in Bridgeless Mode.
617- return ;
618- }
619613 SystraceMessage .beginSection (
620614 Systrace .TRACE_TAG_REACT_JAVA_BRIDGE , "UIImplementation.dispatchViewUpdates" )
621615 .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