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) => {
|
||||
let str = ""
|
||||
Object.entries(styleObject || {}).forEach(([style, value]) => {
|
||||
if (style && value != null) {
|
||||
str += `${style}: ${value}; `
|
||||
for (let key of Object.keys(styleObject || {})) {
|
||||
if (styleObject[key] != null) {
|
||||
str += `${key}:${styleObject[key]};`
|
||||
}
|
||||
})
|
||||
}
|
||||
return str + (customStyles || "")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue