I have some react-native code that reads an object. If an object has a particular property I want it to display the code. A minimized code block looks like this:
return <View>
<Text>Title</Text>
{item.mystring &&
<View>
<Text>Should only be rendered when the mystring property exists and has a value</Text>
</View>
}
</View>
It works fine in most cases, however, if the property mystring does exist but has an empty string I get the following error:
Invariant Violation: Text strings must be rendered within a <Text> component.
Why exactly am I getting this error on an empty string? My preference would be for it to not render the code block.