react-native 报错 Text strings must be rendered within a <Text> component.
前言:
react- native的标签很像微信小程序,本篇记录我做项目遇到的问题。
一、报错信息
1.Text strings must be rendered within a <Text> component.
意思:文本字符串必须在<Text>组件中呈现。
import React, { Component } from "react";
import { ActivityIndicator, StyleSheet, Text, View } from "react-native";
class Demo extends Component {render() {return (<View style={[styles.container, styles.horizontal]}><ActivityIndicator /><ActivityIndicator size="large" /><ActivityIndicator size="small" color="#0000ff" /><ActivityIndicator size="large" color="#00ff00" />s99 //这里用到了字符串但是没有放到Text标签里 <Text>s99</Text></View>);}}const styles = StyleSheet.create({container: {flex: 1,justifyContent: "center"},horizontal: {flexDirection: "row",justifyContent: "space-around",padding: 10}});export default Demo;
解决方案:
<Text>s99</Text>
react-native 报错 Text strings must be rendered within a <Text> component.相关推荐
- react native报错:Expected a component class,got[object object]
正在写RN的视图部分,突然模拟器报错:Expected a component class,got[object object].找也找不到原因.后来才发现是自己粗心大意造成的. 错误代码: < ...
- react native 报错:cannot read property 'length' of undefined
一.报错信息 根据信息,我们可以看出,这个报错信息和以前JS遇到的报错差不多.应该就是使用'.length'的对象没有定义或者没有值造成的. 二.逐步排错 1.先找到错误代码位置 //这两行代码的意思 ...
- 解决React Native报错:Error:Found unexpected optical bounds (red pixel)
问题背景 同样是在升级 gradle plugin V2.2.3 --> gradle plugin V3.0.1后,运行至打包APK期间报错: Error:found unexpected o ...
- react native报错:undefined Unable to resolve module 'Dimensions' from 'App.js
在获取屏幕宽度的时候报错, 原代码: 报错信息: 解决方式:
- React Native报错undefined is not an object(evaluating ‘_reactnative.propTypes’)解决办法...
原程序是这样写的,然后一直出现错误,找不到PropTypes, import React,{Component } from 'react'; import { View, Text, Image, ...
- php stack trace,【原创】解读React Native报错:Run with --stacktrace option to get the stack trace......
问题背景: 一般我们在编译RN时,如果失败,编译器会在终端抛出如下一段文字: FAILURE: Build failed with an exception. * What went wrong: E ...
- 'React' must be in scope when using JSX react/react-in-jsx-scope报错:
'React' must be in scope when using JSX react/react-in-jsx-scope报错: 在头部引入 import React from 'react'即 ...
- React启动报错These dependencies were not found:
React启动报错These dependencies were not found: These dependencies were not found: * @tmp/history in ./s ...
- 有趣且重要的Git知识合集(7)git stash报错 Too many revisions specified: ‘stash@‘ ‘MAA=‘ ‘xml‘ ‘text‘
在我们想要查看stash list中储存的代码时,就先 git stash list 然后会出现下图所示 这时候再输入 git stash show -p stash@{0} 但是,会出现这种报错 T ...
- React项目报错: __WEBPACK_IMPORTED_MODULE_3_react___default.a.memo is not a function
今天用react做项目的时候遇到一个错误 React项目报错: __WEBPACK_IMPORTED_MODULE_3_react___default.a.memo is not a function ...
最新文章
- python对MySQL进行添加修改删除以及字符串的操作
- RPA女子计划—面向日本女性的工作方式改革
- TCP/IP协议精华指南pdf发布
- E: Unable to lock the administration directory (/var/lib/dpkg/)
- 程序员的职业生涯之我见
- 使用IDA Pro动态调试SO文件
- ai钢笔工具怎么描线_AI中钢笔工具绘图的实战操作技巧!(干货满满)
- java反射接口_Java反射详解
- Android应用程序反编译
- Atitit it软件领域职称评级规定,广博方向。 目录 1. 软件工程师资格证	1 1.1. 法规规范 十大标准,三级五晋制。	1 1.2. 组织架构 域职称评级委员会	2 1.3. 人员职责流程表
- 全球知名 CMS 提供商详细清单
- 恩施机器人编程_恩施武汉机器人激光切割机
- 这里带你了解IR2104驱动电路
- linux-xfce4-panel
- cf Educational Codeforces Round 49 D. Mouse Hunt
- Nand Flash管理算法介绍之FTL简介
- 【VRP问题】基于遗传算法求解带容量的VRP问题matlab源码
- 在数组对象中取出对应属性的值
- Vue学习笔记 7.7 周末去哪儿
- 李开复针对马加爵事件写给中国学生的一封信
热门文章
- java-数组-输出二十六个字母
- 一个案例教会你:全面的数据分析应该怎么做?
- 编译原理实验四 语义分析及中间代码生成
- Name was not previously introduced as per JSP.5.3的解决办法
- Excel中取值函数三剑客:LEFT、RIGHT、MID
- linux安装nginx、php、mysql搭建网站
- 关于Class mocking requires to have Objenesis library in the classpath异常的处理
- 微信小程序开发中,图片报403问题(图片加载失败)解决办法
- phpunit问题与解决
- 靶机Who Wants To Be King 1渗透记录