![](/img/trans.png)
[英](ReactJS) Non-interactive elements should not be assigned mouse or keyboard event listeners
[英]How can we resolve eslint error on <p> tag "Non-interactive elements should not be assigned interactive roles"
以下是我嘗試執行但在將其轉換為可訪問鍵盤時遇到錯誤的代碼::= <p className={styles['clear-text']} onClick={clearAllFilters}> {'Clear All'}</p
簡而言之:要么更改元素類型,要么在 eslint 設置中例外。 關於設置,有2個選項:特殊注釋的全局設置
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.