-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid layout for (1)<RCTRootContentView: 0x7bb9e0c0; reactTag: 1; frame = (0 0; 414 736); gestureRecognizers = <NSArray: 0x7bb72450>; layer = <CALayer: 0x7bb783d0>>. position: {nan, nan}. bounds: {{0, 0}, {nan, nan}} #3406
Comments
I've been getting this since 0.11.0 :(. |
@nfranzmeier @jaygarcia Can you submit a PR? |
If my comment/code change helped and you know how to submit a PR, it might be better as I'm unsure of the process... |
Hi there! This issue is being closed because it has been inactive for a while. But don't worry, it will live on with ProductPains! Check out its new home: https://productpains.com/post/react-native/-invalid-layout-for-1rctrootcontentview-0x7bb9e0c0-reacttag-1-frame-0-0-414-736-gesturerecognizers-nsarray-0x7bb72450-layer-calayer-0x7bb783d0-position-nan-nan-bounds-0-0-nan-nan ProductPains helps the community prioritize the most important issues thanks to its voting feature. Also, if this issue is a bug, please consider sending a PR with a fix. |
I got this error :
it seems related to this issue. Can someone submit a PR? I've never written any Objective-C code. |
+1 |
any news or update on this? I'm getting a similar issue: Kind regards, |
@JeroenNelen setting flex to null is what causing this error in my case. changed it to 0 fixed it for me. |
Adding |
Tried setting flex to 0 but still got the same error. It got resolved for me by setting flex to 1. |
I was experience a similar situation where I was adding a dynamic class that has Thank you @damathryx @aymericbouzy |
|
On the latest releases 0.12.0 (also 0.11.4) - When compiling for iphone 4 or 5 (simulator) I get this error when trying to merge the baseline application - the one that is created by react-native init - into an an existing project.
For some reason it works when building for iphone6....
015-10-14 07:52:03.949 [error][tid:main][UIView+React.m:77] Invalid layout for (1)<RCTRootContentView: 0x7bb9e0c0; reactTag: 1; frame = (0 0; 414 736); gestureRecognizers = <NSArray: 0x7bb72450>; layer = <CALayer: 0x7bb783d0>>. position: {nan, nan}. bounds: {{0, 0}, {nan, nan}}
I tracked this down to this function in RCTUtils.m
CGFloat RCTRoundPixelValue(CGFloat value)
{
CGFloat scale = RCTScreenScale();
return round(value * scale) / scale;
}
Apparently using round() which is for the type double, is the problem.
So, I changed it to roundf() which works with CGFloat and now it all works!
CGFloat RCTRoundPixelValue(CGFloat value)
{
CGFloat scale = RCTScreenScale();
CGFloat res = roundf(value * scale) / scale;
//NSLog(@"Result=%d",res); // NVF Fixed all rounds to roundf() so it computes right!!!!
return res;
}
In my codebase I searched for all other round() instances using float similarly and changed them also to use roundf()
All works consistently now.
Please fix this in the baseline -
The text was updated successfully, but these errors were encountered: