Closed ljunb closed 7 years ago
It works fine in version 0.37.0
Can you provide a small sample app that runs into this problem?
I have the same problem. So far unable to track it down to a root cause. I'll post again if I find anything.
I have the same issue, but it's related to the flex layout in the scrollview, wrapping the scrollview in a view and setting style={{flex:1}}
solves my problem.
@DKbyo It also solves my problem! The flex layout of ListView causes the issue in my situation, Thanks!
I ran into the same issue. Wrapping ListView and ScrollView within a
I then undid that code line by line to try to pinpoint the exact issue, and I ended up undoing every single line and the bug was still gone. So I'm scratching my head a bit, and can only think that this is some sort of simulator and/or caching issue within the bundle / Xcode process. Idk!
I have the same issue, but wrapping scrollview in a view with flex:1 did not resolve it. what makes me scratch my head: when I turn on the debugger it works fine, when I turn remote debugging of I get the error...if I dismiss it i see the layout as exspected.
see here https://github.com/facebook/react-native/issues/11846
@DKbyo This solved the same issue for me using 0.40.0 - many thanks :-)
I was having similar issues, but managed to find some instances of flex: null
or flex: undefined
that was causing it.
Either way, it seems to be an issue with flex, causing an overflow, hence the nan
in the error message.
I have just hit the same problem, or at least a problem with the same problem. I get
Invalid layout for (369)<RCTView: .... position: {187.5, nan}. bounds: {{0, 0}, {375, nan}}
Maybe interestingly, the position and bounds values are exactly the same as in the first line in @ljunb's original post. The effect is exactly as described by @florianbepunkt
I have tracker down a solution in my case. The relevant bits (ignore the funny stylesheet construction, its just a wrapper around RN StyleSheet; Button and Images.Loading are my components) of code are:
const styles = StyleSheet.create({
container: (global) => ({
position: 'absolute',
top: 0,
left: 0,
bottom: 0,
right: 0,
backgroundColor: 'rgba(0,0,0,0.50)',
flex: 1,
alignItems: 'center',
}),
....
}) ;
render () {
return (
<View style={ styles.container }>
<View style={ styles.inner }>
<Images.Loading style={ styles.image } />
<Button onPress={ this.onClickCancel } type='cancel' label='Cancel'/>
</View>
</View>
) ;
}
The above gives the reported error. However, if I remove the flex:1 style from the container (which is actually spurious anyway because the the style uses absolute positioning), then it all works fine.
This in on iOS emulator (iPhone 6/iOS 9.3) on ElCapitan, The problem existed with RN0.40; I upgraded to RN0.41 (latest as of a couple of hours ago), problem was still there.
I was facing it in 0.41 for 2 reasons. Thought I 'd share so it can help somebody. To fix it, I
ListView
s and ScrollView
s within a component and set style={{flex:1}}
to that componentflex: null
or flex: undefined
was not set anywhere. In my case, this was happening in a progressBar where I was giving flex: calculatedValue
, where calculatedValue
was undefined in some cases.Hi there! This issue is being closed because it has been inactive for a while. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. Either way, we're automatically closing issues after a period of inactivity. Please do not take it personally!
If you think this issue should definitely remain open, please let us know. The following information is helpful when it comes to determining if the issue should be re-opened:
If you would like to work on a patch to fix the issue, contributions are very welcome! Read through the contribution guide, and feel free to hop into #react-native if you need help planning your contribution.
+1 react-native:0.49
Description
Yesterday I upgraded the RN version from 0.25.1 to 0.39.2, everything works fine until I reset to the root view which build with react-native-scrollable-tab-view. Confusing that the root view is normal when app starts, but it will throws the bellow errors when
resetTo
root view:Android works fine, it happens on iOS only.
Additional Information