react native报错:Expected a component class,got[object object]
正在写RN的视图部分,突然模拟器报错:Expected a component class,got[object object]。找也找不到原因。后来才发现是自己粗心大意造成的。
错误代码:
<view><Text style={sscStyle.content_text_title}>我的订单</Text></view>
正确代码:
<View><Text style={sscStyle.content_text_title}>我的订单</Text>
</View>
两下对比发现。这个标签没有大写。所以报的错误。在RN的视图里面,所有的双标签,第一个字符必须是大写。例如:
<Text></Text>
<View><View>
记录一下。
end
react native报错: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文件报错_React Native常见问题(一)
以下是在开发产品3个月以来遇到多的问题,希望可以帮助到遇到同样问题的小伙伴们 一 node端口被占用(找不到入口): lsof -i:3009:查看所有3009端口 kill -9 14937 干掉1 ...
- React Native: Unexpected token ‘:‘. Expected a ‘)‘ or a ‘,‘ after a parameter declaration
一,现象 模拟器报错: React Native: Unexpected token ':'. Expected a ')' or a ',' after a parameter declaratio ...
- elasticsearch报错expected <block end>, but found BlockMappingStart解决方法
elasticsearch报错expected , but found BlockMappingStart解决方法 参考文章: (1)elasticsearch报错expected , but fou ...
- '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'即 ...
最新文章
- MindSpore基准性能
- 使用NLTK进行英文分词
- android开发 获取相册名称_Android开发之获取相册照片和获取拍照照片
- 理解 Pod 和容器设计模式
- 【开始研究Community Server,转贴一点东西】Community Server资料收集
- 活动服务器优化 暂时关闭,服务器优化之关闭不必要的服务
- Leetcode每日一题:129.sum-root-to-leaf-numbers(求根到叶子节点数字之和)
- 蓝桥杯 2016年C语言组大学B组 C/C++
- 互联网运营数据分析(1):流量分析
- 爬虫之Xpath的使用
- Python办公自动化(八)|使用Python转换PDF,Word/Excel/PPT/md/HTML都能转
- 使用Mybatis-Generator自动生成entity实体、dao接口以及mapper映射文件
- Your shell has not been properly configured to use ‘conda activate‘. If your shell is Bash or a Bour
- Maven打包时指定配置文件
- Python+旧衣物捐赠系统 毕业设计-附源码290942
- android 播放资源mp4,Android播放assets文件里视频文件相关问题分析
- 华为“不造车”的承诺,快到期了
- 7-3 学生成绩录入及查询 (20分)__C++
- Power Query批量合并Excel文件
- SSD制作自己的数据集