React does not recognize the `...` prop on a DOM element

React JavaScript Library

Severity: Minor

What it means

React, in development: React does not recognize the `isActive` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `isactive` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
React's docs give the likely reasons: props copied on with {...props} or cloneElement, a non-standard attribute on a DOM element, or a component written in lower case, such as , which JSX treats as an HTML tag.

Affected Models

  • React 16.8 and later

How to Fix It

  1. Passing {...props} to a <div> or another HTML tag? Take the component's own props out first: const { isActive, ...rest } = props; then <div {...rest}>.

  2. Custom data for the element? React's docs suggest a data attribute, such as data-active={isActive}.

  3. Your own component written in lower case? Start its name with a capital: <MyButton />, not <myButton />.

  4. A similar warning, Invalid DOM property `class`. Did you mean `className`?, means an HTML name was used where React has its own. Use the name it suggests.