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

Function warnInvalidARIAProps

code/new-context-api/public/app.js:15142–15161  ·  view source on GitHub ↗
(type, props)

Source from the content-addressed store, hash-verified

15140}
15141
15142function warnInvalidARIAProps(type, props) {
15143 var invalidProps = [];
15144
15145 for (var key in props) {
15146 var isValid = validateProperty(type, key);
15147 if (!isValid) {
15148 invalidProps.push(key);
15149 }
15150 }
15151
15152 var unknownPropString = invalidProps.map(function (prop) {
15153 return '`' + prop + '`';
15154 }).join(', ');
15155
15156 if (invalidProps.length === 1) {
15157 warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15158 } else if (invalidProps.length > 1) {
15159 warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15160 }
15161}
15162
15163function validateProperties(type, props) {
15164 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