![](/img/trans.png)
[英]IONIC / REACT Line 9:5: Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions
[英]Expected an assignment or function call and instead saw an expression @typescript-eslint/no-unused-expressions (React)
我正在嘗試使用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>
您實際上並沒有調用runSelect
。 嘗試這個:
<span className="selectedValue" onClick={(e) => { e.stopPropagation(); runSelect();}}>25 Miles</span>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.