# Warning: Invalid DOM property `class`. Did you mean `className`?

**Code:** `Invalid DOM property` · **Category:** React · **Seen on:** React

HTML attribute names were used in JSX instead of their React/DOM property names.

## 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

1. Rename attributes (className, htmlFor)
2. Use camelCase event handlers
3. Pass style as an object

## Detailed fix by platform

### React

1. `<label htmlFor="email" className="label" style={{ color: 'red' }} />`

## How to diagnose

1. **Attribute** — Which one is named?
2. **Recent change** — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/react/invalid-dom-property-classname)
