Skip to content

Files

Latest commit

 

History

History
22 lines (16 loc) · 622 Bytes

no-unknown-property.md

File metadata and controls

22 lines (16 loc) · 622 Bytes

Pattern: Invalid DOM property name

Issue: -

Description

React uses camelCase property names and specific DOM attributes. Using unknown property names or incorrect attribute syntax (like HTML's class instead of className) will have no effect and may indicate errors.

Examples

Example of incorrect code:

const Hello = <div class="hello">Hello World</div>;
const Alphabet = <div abc="something">Alphabet</div>;
const IconButton = <div aria-foo="bar" />;

Example of correct code:

const Hello = <div className="hello">Hello World</div>;
const IconButton = <div aria-label="bar" />;