While working with react native application, you may have seen "React native: Cannot add a child that doesn't have a YogaNode or parent without a measure function" error message many times in android device during application development phase.
Cannot add a child that doesn't have a YogaNode to a parent without a measure function! (Trying to add a 'RCTRawText [text: ;]' to a 'RCTView') addChildAt ReactShadowNodeImpl.java:279 addChildAt ReactShadowNodeImpl.java:56 setChildren UIImplementation.java:482 setChildren UIManagerModule.java:441 invoke Method.java invoke JavaMethodWrapper.java:372 invoke JavaModuleWrapper.java:160 run NativeRunnable.java handleCallback Handler.java:751 dispatchMessage Handler.java:95 dispatchMessage MessageQueueThreadHandler.java:29 loop Looper.java:154 run MessageQueueThreadImpl.java:192 run Thread.java:761
You need to follow below points while working with react native application, this ultimately solve your issue.
1. Make use Component hierarchy should be maintain, for example all components like Text, ListView, TextInput etc should be wrapped inside the parent component that is View.
lets see the below example :
<View> <Text> CORRECT </Text> </View>
2. Make sure all the Component tag should be closed properly.
3. Make sure unnecessary semicolons should be removed from the react native layout components & functions.
Do comment in comment box below, in case of any issues or suggestions.
visibly this code :
ReplyDeleteconst { name, delet, data } = this.props
if (name === '') {
return null;
}
else {
return (
-{name}
)
}
}
is reason of bug and i don't know why