JavaScript

JavaScript

By DeepSource

Forbid certain props on Components JS-0394

Performance

Using reserved prop-names like className and style on custom components hurts readability, and makes the code harder to maintain. These props should only be used for DOM nodes like div, a, span, etc.

Bad Practice

<Hello className='foo' />

<Hello style={{color: 'red'}} />

Recommended

<Hello name='Joe' />

<div className='foo' />

<div style={{color: 'red'}} />