[英]Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions (React)
I am trying to run a fucntion on a click event with stopPropagation
and its giving me error like: Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions
我正在尝试使用stopPropagation
对单击事件运行函数,它给我的错误如下: Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions
<span className="selectedValue" onClick={(e) => { e.stopPropagation(); runSelect;}}>25 Miles</span>
You're not actually calling runSelect
.您实际上并没有调用runSelect
。 Try this:尝试这个:
<span className="selectedValue" onClick={(e) => { e.stopPropagation(); runSelect();}}>25 Miles</span>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.