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

Function warnInvalidARIAProps

code/styling/public/app.js:15781–15800  ·  view source on GitHub ↗
(type, props)

Source from the content-addressed store, hash-verified

15779}
15780
15781function warnInvalidARIAProps(type, props) {
15782 var invalidProps = [];
15783
15784 for (var key in props) {
15785 var isValid = validateProperty(type, key);
15786 if (!isValid) {
15787 invalidProps.push(key);
15788 }
15789 }
15790
15791 var unknownPropString = invalidProps.map(function (prop) {
15792 return '`' + prop + '`';
15793 }).join(', ');
15794
15795 if (invalidProps.length === 1) {
15796 warning(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15797 } else if (invalidProps.length > 1) {
15798 warning(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop%s', unknownPropString, type, getStackAddendum());
15799 }
15800}
15801
15802function validateProperties(type, props) {
15803 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