Error: Cannot add a child that doesn't have a YogaNode to a parent without a measure function!
See original GitHub issue- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
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 as TextInput which triggers component removal.
Environment
Environment: OS: Linux 4.13 Node: 9.4.0 Yarn: 1.3.2 npm: 5.7.1 Watchman: 4.9.0 Xcode: N/A Android Studio: 3.1 AI-173.4670197
Packages: (wanted => installed) react: ^16.3.1 => 16.3.1 react-native: ^0.55.2 => 0.55.2
Steps to Reproduce
Simplified example: Change text in TextInput field https://snack.expo.io/SyAcWQFoz
Expected Behavior
<Text>
component stops existing
Actual Behavior
Exception thrown:
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
manageChildren
UIImplementation.java:446
manageChildren
UIManagerModule.java:416
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
Issue Analytics
- State:
- Created 5 years ago
- Reactions:30
- Comments:63 (9 by maintainers)
Top Results From Across the Web
React native: Cannot add a child that doesn't have ...
React native: Cannot add a child that doesn't have a YogaNode or parent node - Stack Overflow. Stack Overflow for Teams – Start...
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 or pare…
Error Message : Cannot add a child that doesn't have a YogaNode to a parent without a measure function! (Trying to add a...
Read more >Error: Cannot add a child that doesn't have a YogaNode to ...
Error: Cannot add a child that doesn't have a YogaNode to a parent without a measure function! 野兽仙贝 关注. 2018.08.16 01:09:31 字数265.
Read more >报错Cannot add a child that doesn't have a YogaNode to ...
遇到一个问题:ReacNative:报错Cannot add a child that doesn't have a YogaNode to a parent without a measure function!完美被这个解决:解决.
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
The issue is that you try to render an empty string outside a
Text
component:If
state.error
is an empty string (falsey value), this transforms into{''}
. And you can’t render an empty string (''
) or zero (0
) outside ofText
component. But all other falsey values will do. Try to turn this into another falsey value.For example (
null
):or (
false
)By the way, I’ve just noticed, that this error message actually shows a text that caused it (notice
Test text
).