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

Function warnUnknownProperties

code/dependency-injection/public/app.js:16052–16069  ·  view source on GitHub ↗
(type, props, canUseEventSystem)

Source from the content-addressed store, hash-verified

16050}
16051
16052var warnUnknownProperties = function (type, props, canUseEventSystem) {
16053 var unknownProps = [];
16054 for (var key in props) {
16055 var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
16056 if (!isValid) {
16057 unknownProps.push(key);
16058 }
16059 }
16060
16061 var unknownPropString = unknownProps.map(function (prop) {
16062 return '`' + prop + '`';
16063 }).join(', ');
16064 if (unknownProps.length === 1) {
16065 warning(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior%s', unknownPropString, type, getStackAddendum$2());
16066 } else if (unknownProps.length > 1) {
16067 warning(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior%s', unknownPropString, type, getStackAddendum$2());
16068 }
16069};
16070
16071function validateProperties$2(type, props, canUseEventSystem) {
16072 if (isCustomComponent(type, props)) {

Callers 1

validateProperties$2Function · 0.70

Calls 3

warningFunction · 0.85
validateProperty$1Function · 0.70
getStackAddendum$2Function · 0.70

Tested by

no test coverage detected