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

Function shouldRemoveAttributeWithWarning

code/redux/public/app.js:4313–4338  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

4311}
4312
4313function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
4314 if (propertyInfo !== null && propertyInfo.type === RESERVED) {
4315 return false;
4316 }
4317 switch (typeof value) {
4318 case 'function':
4319 // $FlowIssue symbol is perfectly valid here
4320 case 'symbol':
4321 // eslint-disable-line
4322 return true;
4323 case 'boolean':
4324 {
4325 if (isCustomComponentTag) {
4326 return false;
4327 }
4328 if (propertyInfo !== null) {
4329 return !propertyInfo.acceptsBooleans;
4330 } else {
4331 var prefix = name.toLowerCase().slice(0, 5);
4332 return prefix !== 'data-' && prefix !== 'aria-';
4333 }
4334 }
4335 default:
4336 return false;
4337 }
4338}
4339
4340function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
4341 if (value === null || typeof value === 'undefined') {

Callers 2

shouldRemoveAttributeFunction · 0.70
app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected