Skip to content
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

[iOS][v41.1] Invalid Layout setting width on View #5

Open
ssomnoremac opened this issue Feb 6, 2017 · 5 comments
Open

[iOS][v41.1] Invalid Layout setting width on View #5

ssomnoremac opened this issue Feb 6, 2017 · 5 comments

Comments

@ssomnoremac
Copy link
Contributor

Invalid layout for (27)<RCTView: 0x7fe4f2446300; reactTag: 27; frame = (0 0; 0 0); layer = <CALayer: 0x60800002f7e0>>. position: {nan, 111.25}. bounds: {{0, 0}, {nan, 222.5}}

For some reason setting the width on two or more View sibling components results in this error. Using the core RN View this isn't the case.

This and this. Real strange. Seems to affect >39.

To reproduce:

     <View flex>
        <Row flex>
          <View style={{backgroundColor: 'powderblue', width:20}}/>
          <View style={{backgroundColor: 'skyblue',  width:20}} />
          <View style={{backgroundColor: 'steelblue', width:20}}/>
        </Row>
        <View style={{backgroundColor: 'skyblue'}} flex/>
        <View style={{backgroundColor: 'steelblue'}} flex/>
      </View>
@zeh
Copy link

zeh commented Feb 17, 2017

Also getting this a lot. Apparently when component views get recycled and have to be redrawn. In my case it's happening on what I'm assuming is the y/height properties (in your case it's x/width).

@ssomnoremac
Copy link
Contributor Author

@zeh, are you getting this on both the simulator and device or have you checked that? My device is Android :(

@zeh
Copy link

zeh commented Feb 17, 2017

@ssomnoremac iOS Simulator only (haven't tested anywhere else).

I have this on pure RN though. It seems to be a lower level issue.

@ssomnoremac
Copy link
Contributor Author

@zeh that's interesting, because in my case if I use RN View it's fine, but Row throws the error. In any case, I fixed it using undefined instead of null as the flex ternary default. Does it make sense to swap out all the nulls? It seems this is just a flex issue though. I'll try to get a PR out tomorrow. Let me know if you can confirm it fixes your case.

@ssomnoremac
Copy link
Contributor Author

So I'm just removing flex from this library because it works natively as a layout prop. Who'd a thought? That realization #6 there. As for this #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants