Skip to content

noReactSpecificProps (since v1.7.2)

Diagnostic Category: lint/nursery/noReactSpecificProps

Sources:

Prevents React-specific JSX properties from being used.

This rule is intended for use in JSX-based frameworks (mainly Solid.js) that do not use React-style prop names.

<Hello className="John" />
nursery/noReactSpecificProps.js:1:8 lint/nursery/noReactSpecificProps  FIXABLE  ━━━━━━━━━━━━━━━━━━━━

   This JSX attribute is specific to React.
  
  > 1 │ <Hello className="John" />
          ^^^^^^^^^
    2 │ 
  
   This attribute may not be supported by non-React frameworks, as it is not native to HTML.
  
  > 1 │ <Hello className="John" />
          ^^^^^^^^^
    2 │ 
  
   Safe fix: Replace this attribute name with "class"
  
    1  - <Hello·className="John"·/>
      1+ <Hello·class="John"·/>
    2 2  
  
<Hello class="Doe" />