Looks like updating to 17.1.0 enables label-has-associated-control but it seems to be failing for a correct label/input. To my understanding, the correct structure could either be a nested input within a label OR use the htmlFor prop with a valid DOM ID.
In this case, we're using htmlFor:
const Foo () => {
return (
<label htmlFor="filterAll">
...
</label>
<input id="filterAll" />
)
}
and the linter is giving us the following error
error A form label must be associated with a control jsx-a11y/label-has-associated-control
Looks like updating to
17.1.0enableslabel-has-associated-controlbut it seems to be failing for a correct label/input. To my understanding, the correct structure could either be a nestedinputwithin a label OR use thehtmlForprop with a valid DOM ID.In this case, we're using
htmlFor:and the linter is giving us the following error
error A form label must be associated with a control jsx-a11y/label-has-associated-control