MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / warnInvalidARIAProps

Function warnInvalidARIAProps

code/third-party/public/app.js:15014–15033  ·  view source on GitHub ↗
(type, props)

Source from the content-addressed store, hash-verified

15012}
15013
15014function warnInvalidARIAProps(type, props) {
15015 var invalidProps = [];
15016
15017 for (var key in props) {
15018 var isValid = validateProperty(type, key);
15019 if (!isValid) {
15020 invalidProps.push(key);
15021 }
15022 }
15023
15024 var unknownPropString = invalidProps.map(function (prop) {
15025 return '`' + prop + '`';
15026 }).join(', ');
15027
15028 if (invalidProps.length === 1) {
15029 warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15030 } else if (invalidProps.length > 1) {
15031 warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15032 }
15033}
15034
15035function validateProperties(type, props) {
15036 if (isCustomComponent(type, props)) {

Callers 1

validatePropertiesFunction · 0.70

Calls 3

warningFunction · 0.85
validatePropertyFunction · 0.70
getStackAddendumFunction · 0.70

Tested by

no test coverage detected