Skip to content

Files

Latest commit

 

History

History
19 lines (13 loc) · 437 Bytes

jsx-boolean-value.md

File metadata and controls

19 lines (13 loc) · 437 Bytes

Pattern: Explicit true value for boolean JSX attribute

Issue: -

Description

In JSX, boolean attributes can be written using shorthand syntax by omitting the value. Using explicit true values creates unnecessary verbosity and inconsistency in the codebase.

Examples

Example of incorrect code:

const Hello = <Hello personal={true} />;

Example of correct code:

const Hello = <Hello personal />;