Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// custom attributes (`data-` and `aria-`)
if (isCustomAttribute(propertyName)) {
props[propertyName] = propertyValue;
continue;
}
// make HTML DOM attribute/property consistent with React attribute/property
reactProperty = config.html[propertyName.toLowerCase()];
if (reactProperty) {
if (
Object.prototype.hasOwnProperty.call(
DOMProperty.properties,
reactProperty
) &&
DOMProperty.properties[reactProperty].hasBooleanValue
) {
props[reactProperty] = true;
} else {
props[reactProperty] = propertyValue;
}
continue;
}
// make SVG DOM attribute/property consistent with React attribute/property
reactProperty = config.svg[propertyName];
if (reactProperty) {
props[reactProperty] = propertyValue;
} else if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {
props[propertyName] = propertyValue;
}
}
for (propertyName in attributes) {
propertyValue = attributes[propertyName];
// custom attributes (`data-` and `aria-`)
if (isCustomAttribute(propertyName)) {
props[propertyName] = propertyValue;
continue;
}
// make HTML DOM attribute/property consistent with React attribute/property
reactProperty = config.html[propertyName.toLowerCase()];
if (reactProperty) {
if (
Object.prototype.hasOwnProperty.call(
DOMProperty.properties,
reactProperty
) &&
DOMProperty.properties[reactProperty].hasBooleanValue
) {
props[reactProperty] = true;
} else {
props[reactProperty] = propertyValue;
}
continue;
}
// make SVG DOM attribute/property consistent with React attribute/property
reactProperty = config.svg[propertyName];
if (reactProperty) {
props[reactProperty] = propertyValue;
} else if (utilities.PRESERVE_CUSTOM_ATTRIBUTES) {