Improve performance of styleable util
This commit is contained in:
parent
d6f33b2191
commit
96882e7eca
|
@ -5,11 +5,11 @@ import { builderStore } from "stores"
|
||||||
*/
|
*/
|
||||||
export const buildStyleString = (styleObject, customStyles) => {
|
export const buildStyleString = (styleObject, customStyles) => {
|
||||||
let str = ""
|
let str = ""
|
||||||
Object.entries(styleObject || {}).forEach(([style, value]) => {
|
for (let key of Object.keys(styleObject || {})) {
|
||||||
if (style && value != null) {
|
if (styleObject[key] != null) {
|
||||||
str += `${style}: ${value}; `
|
str += `${key}:${styleObject[key]};`
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
return str + (customStyles || "")
|
return str + (customStyles || "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue