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

Function warnInvalidARIAProps

code/event-handlers/public/app.js:15111–15130  ·  view source on GitHub ↗
(type, props)

Source from the content-addressed store, hash-verified

15109}
15110
15111function warnInvalidARIAProps(type, props) {
15112 var invalidProps = [];
15113
15114 for (var key in props) {
15115 var isValid = validateProperty(type, key);
15116 if (!isValid) {
15117 invalidProps.push(key);
15118 }
15119 }
15120
15121 var unknownPropString = invalidProps.map(function (prop) {
15122 return '`' + prop + '`';
15123 }).join(', ');
15124
15125 if (invalidProps.length === 1) {
15126 warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15127 } else if (invalidProps.length > 1) {
15128 warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15129 }
15130}
15131
15132function validateProperties(type, props) {
15133 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