Skip to content

Commit 213ea30

Browse files
aaronechiufacebook-github-bot
authored andcommitted
Don't enqueue another UI operation if we're already on the UI thread
Reviewed By: alexeylang Differential Revision: D5085488 fbshipit-source-id: 0613c1403a67d63ad06ce2db9950d902f1c6473a
1 parent 2bf512b commit 213ea30

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,7 @@ protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
105105
mWasMeasured = true;
106106
// Check if we were waiting for onMeasure to attach the root view.
107107
if (mReactInstanceManager != null && !mIsAttachedToInstance) {
108-
// Enqueue it to UIThread not to block onMeasure waiting for the catalyst instance creation.
109-
UiThreadUtil.runOnUiThread(new Runnable() {
110-
@Override
111-
public void run() {
112-
attachToReactInstanceManager();
113-
}
114-
});
108+
attachToReactInstanceManager();
115109
}
116110
} finally {
117111
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);

0 commit comments

Comments
 (0)