我有以下代码:
Enabled = (id) => {
let removal = null;
if (!this.props.disabled) {
removal = (
<span
className="chipRemove"
onClick={() => this.onDelete(id)}
>
x
</span>)
;
}
return removal;
}
它运行良好,但 linter 给了我:
jsx-a11y/no-static-element-interactions
我该如何解决这个错误(根据jsx-a11y
)?