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) {
177
177
*
178
178
* @return The num of root view
179
179
*/
180
- private int getRootViewNum () {
180
+ public int getRootViewNum () {
181
181
return mOperationsQueue .getNativeViewHierarchyManager ().getRootViewNum ();
182
182
}
183
183
@@ -610,12 +610,6 @@ public void measureLayoutRelativeToParent(
610
610
611
611
/** Invoked at the end of the transaction to commit any updates to the node hierarchy. */
612
612
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
- }
619
613
SystraceMessage .beginSection (
620
614
Systrace .TRACE_TAG_REACT_JAVA_BRIDGE , "UIImplementation.dispatchViewUpdates" )
621
615
.arg ("batchId" , batchId )
Original file line number Diff line number Diff line change @@ -719,7 +719,12 @@ public void onBatchComplete() {
719
719
listener .willDispatchViewUpdates (this );
720
720
}
721
721
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
+ }
723
728
} finally {
724
729
Systrace .endSection (Systrace .TRACE_TAG_REACT_JAVA_BRIDGE );
725
730
}
You can’t perform that action at this time.
0 commit comments