React Native Invariant Violation: Text strings must be rendered within a <Text> component.

项目中有时我们会遇到如下错误:

Invariant Violation: Text strings must be rendered within a <Text> component.

解决办法:

仔细检查代码,一般该错误都是语法错误引起

示例:

 

 

查找许久,终于找到了原因:

原来是语法错误,多写了个;

 

posted @ 2021-06-20 15:07  小菜看代码  阅读(814)  评论(0编辑  收藏  举报