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

Function shouldRemoveAttributeWithWarning

code/styling/public/app.js:4062–4087  ·  view source on GitHub ↗
(name, value, propertyInfo, isCustomComponentTag)

Source from the content-addressed store, hash-verified

4060}
4061
4062function shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {
4063 if (propertyInfo !== null && propertyInfo.type === RESERVED) {
4064 return false;
4065 }
4066 switch (typeof value) {
4067 case 'function':
4068 // $FlowIssue symbol is perfectly valid here
4069 case 'symbol':
4070 // eslint-disable-line
4071 return true;
4072 case 'boolean':
4073 {
4074 if (isCustomComponentTag) {
4075 return false;
4076 }
4077 if (propertyInfo !== null) {
4078 return !propertyInfo.acceptsBooleans;
4079 } else {
4080 var prefix = name.toLowerCase().slice(0, 5);
4081 return prefix !== 'data-' && prefix !== 'aria-';
4082 }
4083 }
4084 default:
4085 return false;
4086 }
4087}
4088
4089function shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {
4090 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