Ask questionsWarning: Unknown DOM property for. Did you mean htmlFor?

I get this warning whenever I attempt to use the for property on a <label> element. See for a description of the for attribute.


Answer questions AMorgaut

I find this Error message counter intuitive

Looking at:

Warning: Unknown DOM property for. Did you mean htmlFor?

Any Wev developer new to React (or using this attribute in JSX for the 1st time) will think

WTF! how can the DOM <label> "for" property be Unknown! It's been here for ages !

Looking at the number of projects linking to this issue is a good hint to see what I mean.

A more accurate Error message could be something like

Warning: Unknown JSX property for. Did you mean htmlFor?

This would more rapidly point to the right direction


Related questions

Disable react strict mode on third party libraries hot 6
TypeError: Object(...) is not a function
React@16.9 block `javascript:void(0);`
Refs - &#34;object is not extensible&#34; hot 4
Warning: validateDOMNesting(...): <tr> cannot appear as a child of <table> hot 3
"DevTools v4 is incompatible with this version of React" with React Native & latest version of React hot 3
[ESLint] Feedback for 'exhaustive-deps' lint rule hot 3
React custom hook "Should have a queue. This is likely a bug in React" error message. hot 2
useEffect causes 'callback is not a function' exception hot 2
DevTools: Updating state or props in devtools does not trigger component update. hot 2
Infinite loop in useEffect using blank object or array hot 2
Error on unit test : Cannot read property 'Symbol(Symbol.iterator)' of undefined hot 2
False-positive security precaution warning (`javascript:` URLs) hot 2
Hooks API - hook breaks when exported from module hot 2
Function components do not support contextType. hot 2
Github User Rank List