Pattern: Explicit true
value for boolean JSX attribute
Issue: -
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.
Example of incorrect code:
const Hello = <Hello personal={true} />;
Example of correct code:
const Hello = <Hello personal />;