Cannot Add a child that doesn't have a YogaNode to a parent with out a measure function
See original GitHub issueI’ve been trying to get React Native up and running for a project I’m working on. It works beautifully for IOS, however on Android every time I try to use a Text component I keep getting the error
Cannot add a child that doesn't have a
YogaNode to a parent without a measure function!
Trying to add a ReactVirtualTextShadowNode to a NativeViewWrapper.
my entire code is
import React, { PureComponent } from 'react';
import { Text } from 'react-native';
class App extends PureComponent {
render() {
return (
<Text>Hello World</Text>
);
}
}
export default App;
I’m using react native 0.4.3 Any ideas what could be causing this and how I could fix it?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:30
- Comments:67 (5 by maintainers)
Top Results From Across the Web
Error: Cannot add a child that doesn't have a YogaNode to a ...
Cannot add a child that doesn't have a YogaNode to a parent without a measure function exception when Component co-existing in same parent ......
Read more >React native: Cannot add a child that doesn't have a ...
Now if I try to run the code by adding flexdemo.js code into App.js then everything works fine. Changed The App.js like this:...
Read more >React native: Cannot add a child that does not have a ...
React native : Cannot add a child that doesn't have a YogaNode or parent without a measure function. While working with react native ......
Read more >Cannot add a child that doesn't have a YogaNode to a parent ...
Coding example for the question Cannot add a child that doesn't have a YogaNode to a parent without measure node-React Native.
Read more >Cannot add a child that doesn't have a YogaNode or pare…
Aug 27, 2018 - React native: Cannot add a child that doesn't have a YogaNode or parent without a measure function. While working...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I got this error in RN 0.49.1 in some conditional JSX that relied on a value’s being truthy to decide whether a View shows up or not. I fixed the error using the classic double exclamation !!, i.e. “{!!value” instead of “{value.”
Aah silly error but still the stack trace is too confusing: I had my button tag like:
which was causing the error . This used to work in old react-native. But now, no string values should be without the <Text> tag.
So i resolved it by replacing the above code with