Skip to content

Commit 300cb03

Browse files
ayc1Facebook Github Bot 4
authored and
Facebook Github Bot 4
committed
Remove ReactRootView's MeasureSpec assertion
Reviewed By: astreet Differential Revision: D3811226 fbshipit-source-id: 611e5a2960928c19d93823616d68aa11a9786bf6
1 parent 4f89fa9 commit 300cb03

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

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

+1-13
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,7 @@ public ReactRootView(Context context, AttributeSet attrs, int defStyle) {
8080

8181
@Override
8282
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
83-
int widthMode = MeasureSpec.getMode(widthMeasureSpec);
84-
int heightMode = MeasureSpec.getMode(heightMeasureSpec);
85-
86-
if (widthMode == MeasureSpec.UNSPECIFIED || heightMode == MeasureSpec.UNSPECIFIED) {
87-
throw new IllegalStateException(
88-
"The root catalyst view must have a width and height given to it by it's parent view. " +
89-
"You can do this by specifying MATCH_PARENT or explicit width and height in the " +
90-
"layout. widthMode=" + widthMode + ", heightMode=" + heightMode);
91-
}
92-
93-
setMeasuredDimension(
94-
MeasureSpec.getSize(widthMeasureSpec),
95-
MeasureSpec.getSize(heightMeasureSpec));
83+
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
9684

9785
mWasMeasured = true;
9886
// Check if we were waiting for onMeasure to attach the root view

0 commit comments

Comments
 (0)