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

Function warnUnknownProperties

code/communication/public/app.js:15994–16011  ·  view source on GitHub ↗
(type, props, canUseEventSystem)

Source from the content-addressed store, hash-verified

15992}
15993
15994var warnUnknownProperties = function (type, props, canUseEventSystem) {
15995 var unknownProps = [];
15996 for (var key in props) {
15997 var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
15998 if (!isValid) {
15999 unknownProps.push(key);
16000 }
16001 }
16002
16003 var unknownPropString = unknownProps.map(function (prop) {
16004 return '`' + prop + '`';
16005 }).join(', ');
16006 if (unknownProps.length === 1) {
16007 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());
16008 } else if (unknownProps.length > 1) {
16009 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());
16010 }
16011};
16012
16013function validateProperties$2(type, props, canUseEventSystem) {
16014 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