MCPcopy Create free account
hub / github.com/reactjs/react-rails / warnUnknownProperties

Function warnUnknownProperties

lib/assets/react-source/development/react.js:9285–9307  ·  view source on GitHub ↗
(type, props, canUseEventSystem)

Source from the content-addressed store, hash-verified

9283 }
9284
9285 var warnUnknownProperties = function (type, props, canUseEventSystem) {
9286 {
9287 var unknownProps = [];
9288
9289 for (var key in props) {
9290 var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);
9291
9292 if (!isValid) {
9293 unknownProps.push(key);
9294 }
9295 }
9296
9297 var unknownPropString = unknownProps.map(function (prop) {
9298 return '`' + prop + '`';
9299 }).join(', ');
9300
9301 if (unknownProps.length === 1) {
9302 error('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', unknownPropString, type);
9303 } else if (unknownProps.length > 1) {
9304 error('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', unknownPropString, type);
9305 }
9306 }
9307 };
9308
9309 function validateProperties$2(type, props, canUseEventSystem) {
9310 if (isCustomComponent(type, props)) {

Callers 1

validateProperties$2Function · 0.70

Calls 2

validateProperty$1Function · 0.70
errorFunction · 0.70

Tested by

no test coverage detected