刚才又遇到了一个坑,找了好久,问题如下:

react-native 报错 RawText "" must be wrapped in an explicit <Text> component

开始以为是Text标签怎么有问题了,结果是下面的原因影响的:

react-native 报错 RawText "" must be wrapped in an explicit <Text> component

上图第二行,标签和注释中间多了一个空格,就会报这个错误。

解决办法

1.将空格删掉

<RefText ref="reftext"/>{/* <RefText...*/}

2.换行

<RefText ref="reftext"/>
{/* <RefText...*/}

It works!

相关文章:

  • 2021-10-10
  • 2022-12-23
  • 2021-10-06
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-16
  • 2021-09-08
  • 2021-05-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案