Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 501 Bytes

no-jsx-inline-style-prop.md

File metadata and controls

22 lines (15 loc) · 501 Bytes

no-jsx-inline-style-prop

JSX Element does not contain inline style prop.

Rule Details

Inline style props adds clutter to a JSX Element definition - It is preferable to extract the style values to a separate variable.

Examples of incorrect code for this rule:

// not ok, style value is declared inline
<div style={{ backgroundColor: "red" }} />

Examples of correct code for this rule:

// ok
const divStyle = { backgroundColor: "red" };
<div style={divStyle} />;