React 之 Expected an assignment or function call and instead saw an expression 解决办法

两个问题: 

Line 13:57: Expected an assignment or function call and instead saw an expression  no-unused-expressions
Line 24:68:  'e' is not defined                                                     no-undef

翻译:

第xx行:期望是赋值或函数调用, 不能是一个表达式 ( 意思就是函数没有调用,要加括号=>"( )" )

第xx行:“e”未定义 (意思是函数内部用了形参, 但是函数调用的时候没有传入形参)

解决办法:

检查调用的表达式, 是否没有调用(解决第一个错误)

然后检查传参(解决第二个错误)

发布了127 篇原创文章 · 获赞 150 · 访问量 48万+

猜你喜欢

转载自blog.csdn.net/qq_40259641/article/details/103251557