Skip to content

Commit

Permalink
Warn for ARIA typos on custom elements
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sebmarkbage committed Mar 30, 2023
1 parent 73deff0 commit fa37b7d
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import {ATTRIBUTE_NAME_CHAR} from './isAttributeNameSafe';
import isCustomComponent from './isCustomComponent';
import validAriaProperties from './validAriaProperties';
import hasOwnProperty from 'shared/hasOwnProperty';

Expand Down Expand Up @@ -110,8 +109,5 @@ function warnInvalidARIAProps(type, props) {
}

export function validateProperties(type, props) {
if (isCustomComponent(type, props)) {
return;
}
warnInvalidARIAProps(type, props);
}

0 comments on commit fa37b7d

Please sign in to comment.