component Hi, I have this error in a native reaction and can't figure out...">

React Native error: Raw "" must be enclosed in an explicit <Text> component

enter image description here

Hi, I have this error in a native reaction and can't figure out what causes it. Help would be greatly appreciated.

thank

+4
source share
6 answers

The problem is the gap. However, using tabs is not considered a space. Try removing the space between the tag and the comment on lines 32 and 37.

<View> {/*green*/}

should be either

<View>{/*green*/}

or

<View>
    {/*green*/}
+19
source

I encountered a similar error when checking if the component should be displayed as follows:

{somevariable && <Text>abcd</Text>}

, somevariable 0, somevariable -, , , , 0 React. , , .

{!!somevariable && <Text>abcd</Text>}
+19

. - Preferences | Editor | General | Appearance

0

, / .js JSX. JSX, . , , - node_module node npm install .

0

, :

 <View style={{width:40, height:40, backgroundColor:"green", margin:5}}>
                    <Text style={{fontSize:18}}>格子{this.state.size1}</Text>
                </View>

not

格子 {this.state.size1}

0

:

0

Source: https://habr.com/ru/post/1655712/


All Articles