Skip to content

Commit 2cc851e

Browse files
committed
add React error code and why
1 parent a8d9ff0 commit 2cc851e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ Android-Note里面记录了有关Android的常用基础知识、面试中经常
122122

123123
- [ReactNative入门](/ReactNative相关/ReactNative入门.md)
124124
- [短信验证码倒计时控件](/ReactNative相关/短信验证码倒计时控件.md)
125+
- [ReactNative报错记录](/ReactNative相关/ReactNative报错记录.md)
125126

126127

127128
----
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# React-Native 报错记录
2+
3+
- ``xxx is not defined``
4+
5+
例如:``Component is not defined``
6+
错误原因:在当前的js文件中没有定义或者没有引入这个组建,并且有调用的地方
7+
8+
- ``JSX attributes must only assigned a non-empty expression(29:28)``
9+
10+
错误原因:这个报错就非常简单了,已经告诉我们在哪一行了,错误原因就是,定义了之后不能为空
11+
12+
- ``Cannot read property 'Aspect' of undefined``
13+
14+
错误原因:没有在当前文件夹下运行``react-native start``,导致一些关键的东西引入不进来
15+
16+
- ``undefined is not an object(evaluating 'Daily_Service.props.navigation')``
17+
18+
错误原因:一般来说,我们这样写了代码,就是因为我们认为,可以用this,或者用到某个对象的时候,但是它本身是调用不了的。
19+
20+
21+
22+
23+
24+
25+
- 在View添加了onPress,但是在点击的时候,不会产生任何效果,View没有这样的方法,当遇到需要这样操作的方法的时候可以加入<TouchableOpacity> </TouchableOpacity>
26+
27+
28+
29+
30+
31+

0 commit comments

Comments
 (0)