简体   繁体   中英

Linting jsx-a11y adding role to div element

I am having trouble with no-static-element-interactions

Here is my code that doesn't pass it

      <div
        className={ `selector-button ${ displayType === "GRID" && "active" }` }
        onClick={ this.handleClick.bind( this, "GRID" ) }
        role="button"
      >

Even adding a role="button" can't help me to pass through.

this is related to https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/214 issue on eslint-plugin-jsx-a11y plugin repo.

Please follow the conversation their.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM