Self-Closing Tags

Always include a single space in self-closing tags.

ESLint: react/jsx-tag-spacing and no-multi-spaces

Examples

Incorrect code for this rule:

<Snow/>
<Snow                 />
<Snow
 />

Correct code for this rule:

<Snow />

Curly Braces Padding

Do not pad JSX curly braces with spaces.

ESLint: react/jsx-curly-spacing

Examples

Incorrect code for this rule:

<Winter element={ snow } />

Correct code for this rule:

<Winter element={snow} />

results matching ""

    No results matching ""