Skip to content

Commit 9220287

Browse files
committed
Warn for ARIA typos on custom elements
Normally we allow any attribute/property on custom elements. However it's a shared namespace. The `aria-` namespace applies to all generic elements which are shared with custom elements. So arguably adding custom extensions there is a really bad idea since it can conflict with future additions. It's possible there is a new standard one that's polyfilled by a custom element but the same issue applies to React in general that we might warn for very new additions so we just have to be quick on that.
1 parent 73deff0 commit 9220287

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

packages/react-dom-bindings/src/shared/ReactDOMInvalidARIAHook.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
import {ATTRIBUTE_NAME_CHAR} from './isAttributeNameSafe';
9-
import isCustomComponent from './isCustomComponent';
109
import validAriaProperties from './validAriaProperties';
1110
import hasOwnProperty from 'shared/hasOwnProperty';
1211

@@ -76,7 +75,7 @@ function validateProperty(tagName, name) {
7675
return true;
7776
}
7877

79-
function warnInvalidARIAProps(type, props) {
78+
export function validateProperties(type, props) {
8079
if (__DEV__) {
8180
const invalidProps = [];
8281

@@ -108,10 +107,3 @@ function warnInvalidARIAProps(type, props) {
108107
}
109108
}
110109
}
111-
112-
export function validateProperties(type, props) {
113-
if (isCustomComponent(type, props)) {
114-
return;
115-
}
116-
warnInvalidARIAProps(type, props);
117-
}

0 commit comments

Comments
 (0)