mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-22 03:42:14 +00:00
React dom invalid aria hook (#7744)
* Add a hook that throws a runtime warning for invalid WAI ARIA attributes and values. * Resolved linting errors. * Added a test case for many props. * Added a test case for ARIA attribute proper casing. * Added a warning for uppercased attributes to ReactDOMInvalidARIAHook
This commit is contained in:
committed by
Brandon Dail
parent
b6ba117b7e
commit
95896408e7
11
warnings/invalid-aria-prop.md
Normal file
11
warnings/invalid-aria-prop.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: Invalid ARIA Prop Warning
|
||||
layout: single
|
||||
permalink: warnings/invalid-aria-prop.html
|
||||
---
|
||||
|
||||
The invalid-aria-prop warning will fire if you attempt to render a DOM element with an aria-* prop that does not exist in the Web Accessibility Initiative (WAI) Accessible Rich Internet Application (ARIA) [specification](https://www.w3.org/TR/wai-aria-1.1/#states_and_properties).
|
||||
|
||||
1. If you feel that you are using a valid prop, check the spelling carefully. `aria-labelledby` and `aria-activedescendant` are often misspelled.
|
||||
|
||||
2. React does not yet recognize the attribute you specified. This will likely be fixed in a future version of React. However, React currently strips all unknown attributes, so specifying them in your React app will not cause them to be rendered
|
||||
Reference in New Issue
Block a user