Sometimes, we may run into the "Invalid ARIA Prop Warning" when we’re developing React apps.
In this article, we’ll look at how to fix the "Invalid ARIA Prop Warning" when we’re developing React apps.
Fix the "Invalid ARIA Prop Warning" When Developing React Apps
To fix the "Invalid ARIA Prop Warning" when we’re developing React apps, we should make sure that the aria-* prop that we add to an element is a valid aria-* prop.
We should check the spelling of the attribute carefully.
Some attributes like aria-labelledby
and aria-activedescendant
are often misspelled.
Also, newer aria-* attributes may not be recognized by React yet. They’ll be recognized in later versions.
React strips out all unknown attributes when components are rendered, so aria-* attributes not recognized by React will not be rendered.
Conclusion
To fix the "Invalid ARIA Prop Warning" when we’re developing React apps, we should make sure that the aria-* prop that we add to an element is a valid aria-* prop.
We should check the spelling of the attribute carefully.