diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.java index 1b3cebc1f..bc68ab326 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/ShadowNodeRegistry.java @@ -28,9 +28,7 @@ public class ShadowNodeRegistry { } public void addRootNode(ReactShadowNode node) { - // TODO(6242243): This should be asserted... but UIManagerModule is - // thread-unsafe and calls this on the wrong thread. - //mThreadAsserter.assertNow(); + mThreadAsserter.assertNow(); int tag = node.getReactTag(); mTagsToCSSNodes.put(tag, node); mRootTags.put(tag, true); diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java index 186a4d435..5f124ab88 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java @@ -205,7 +205,12 @@ public class UIImplementation { int heightMeasureSpec = rootView.getHeightMeasureSpec(); updateRootView(rootCSSNode, widthMeasureSpec, heightMeasureSpec); - mShadowNodeRegistry.addRootNode(rootCSSNode); + context.runOnNativeModulesQueueThread(new Runnable() { + @Override + public void run() { + mShadowNodeRegistry.addRootNode(rootCSSNode); + } + }); // register it within NativeViewHierarchyManager mOperationsQueue.addRootView(tag, rootView, context);