4 ms·
For making it under 200 LoC, `setProperty` could be written without the hardcoded list: function setProperty(prop, value, elem) { if (prop in elem)
by efortis 2y ago
For making it under 200 LoC, `setProperty` could be written without the hardcoded list:
function setProperty(prop, value, elem) {
if (prop in elem)
elem[prop] = value
else
elem.setAttribute(prop, value)
}
https://github.com/uxtely/js-utils/blob/6154c64494301199144a2d7bdf2d56e68ff852bc/react-create-element/createElement.js#L11 https://github.com/uxtely/js-utils/blob/6154c64494301199144a...