react native Error: Text strings must be rendered within a
<Text />component
"vscode" does not display errors, it can only be checked during the rendering process, so I summarized the various types that I found.
<View> <Text>Hello</Text> </View>
delete the space
{list.length && (
<View />
)}
list.length value is 0, so it renders 0.
const text = "";
{text && (
<View />
)}
text value is "", so it renders "".
const count = 0;
{count && (
<View />
)}
count value is 0, so it renders 0.
const count = 0;
{!!count && (
<View />
)}
If you want to render it only if there is a value, write the !! on front