<Item> rendering error with children in Native Base 2.8.1
See original GitHub issueHi NativeBase dev team,
Issue Description
Since I updated Native Base to version 2.8.1, I have encountered this error when using Native Base <Item error floatingLabel> with {children} inside:
TypeError: TypeError: TypeError: undefined is not an object (evaluating ‘this.props.children[i].props.name’)
node, npm, react-native, react and native-base version, expo version if used
"dependencies": { "expo": "^30.0.1", "native-base": "^2.8.1", "react": "16.3.1", "redux-form": "^7.4.2", "react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz", }
Expected behaviour
Actual behaviour
Error as I described above.
Steps to reproduce
Add an InputField:
Then add a FieldWrapper:
When touched
= true and error
= true, the error TypeError: TypeError: TypeError: undefined is not an object (evaluating 'this.props.children[i].props.name')
appears.
Is the bug present in both iOS and Android or in any one of them?
I am testing on Android.
Any other additional info which would help us debug the issue quicker.
It works perfectly with the same code in 2.8.0 but it is not working in 2.8.1.
The error can be resolved if I remove either {children} or <Icon>
in these lines:
<Item error floatingLabel> {children} <Icon name='close-circle' /> </Item>
Issue Analytics
- State:
- Created 5 years ago
- Comments:13 (4 by maintainers)
Top GitHub Comments
Your solution works well! Sorry for using another account at home. Even though in theory, I see no differences between mine and yours. In my case the code looks more complex but I managed to make it work according to your idea. Thank you!
Besides, the version 2.8.0 does not have this issue. So I guess you should check it one day.
Thank you very much! I will try your solution and let you know soon.