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

Function warnUnknownProperties

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

Source from the content-addressed store, hash-verified

15957}
15958
15959var warnUnknownProperties = function (type, props, canUseEventSystem) {
15960 var unknownProps = [];
15961 for (var key in props) {
15962 var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
15963 if (!isValid) {
15964 unknownProps.push(key);
15965 }
15966 }
15967
15968 var unknownPropString = unknownProps.map(function (prop) {
15969 return '`' + prop + '`';
15970 }).join(', ');
15971 if (unknownProps.length === 1) {
15972 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());
15973 } else if (unknownProps.length > 1) {
15974 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());
15975 }
15976};
15977
15978function validateProperties$2(type, props, canUseEventSystem) {
15979 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