Linting jsx-a11y 向 div 元素添加角色
Linting jsx-a11y adding role to div element
我遇到了 no-static-element-interactions
的问题
这是我没有通过的代码
<div
className={ `selector-button ${ displayType === "GRID" && "active" }` }
onClick={ this.handleClick.bind( this, "GRID" ) }
role="button"
>
加个role="button"
也无法通过
这与 eslint-plugin-jsx-a11y 插件仓库上的 https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/214 问题有关。
请关注他们的对话。
我遇到了 no-static-element-interactions
的问题这是我没有通过的代码
<div
className={ `selector-button ${ displayType === "GRID" && "active" }` }
onClick={ this.handleClick.bind( this, "GRID" ) }
role="button"
>
加个role="button"
也无法通过
这与 eslint-plugin-jsx-a11y 插件仓库上的 https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/214 问题有关。
请关注他们的对话。