Warning: Invalid DOM property `class`. Did you mean `className`?
HTML attribute names were used in JSX instead of their React/DOM property names.
Seen on:
React
Meaning
JSX uses DOM property names: className, htmlFor, tabIndex, readOnly, onClick (camelCase events), style objects. Pasted HTML often keeps class/for/onclick strings.
Common causes
- class instead of className
- for instead of htmlFor
- onclick="..." strings instead of onClick={fn}
- style as a string
⚡ Quick fix
- Rename attributes (className, htmlFor)
- Use camelCase event handlers
- Pass style as an object
Detailed fix by platform
React
<label htmlFor="email" className="label" style={{ color: 'red' }} />
How to diagnose
- Attribute — Which one is named?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026