React does not recognize the `...` prop on a DOM element
React JavaScript Library
Severity: MinorWhat 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
Affected Models
- React 16.8 and later
How to Fix It
-
Passing {...props} to a <div> or another HTML tag? Take the component's own props out first: const { isActive, ...rest } = props; then <div {...rest}>.
-
Custom data for the element? React's docs suggest a data attribute, such as data-active={isActive}.
-
Your own component written in lower case? Start its name with a capital: <MyButton />, not <myButton />.
-
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.