From 47587de0b2927a9e5ce9162836aaed180707f9c9 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 20 Dec 2023 14:45:44 -0600 Subject: [PATCH] Perf improvements --- src/alf/lib/theme.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/alf/lib/theme.ts b/src/alf/lib/theme.ts index 9dc2b48698..40fd82b824 100644 --- a/src/alf/lib/theme.ts +++ b/src/alf/lib/theme.ts @@ -341,18 +341,17 @@ export const createTheme = < if (properties[prop]) { _applyStyleProperty(styles, prop, value) } else if (macros[prop]) { - styles = { - ...styles, - // @ts-ignore no index sig, it's fine - ...(rawProps[prop] !== false ? macros[prop](value, tokens) : {}), - } + Object.assign( + styles, + rawProps[prop] !== false ? macros[prop](value, tokens) : {}, + ) } else if (breakpoints[prop]) { - for (const b of Object.keys(breakpoints)) { + for (const b in breakpoints) { if (activeBreakpoints.includes(b)) { // @ts-ignore no index sig, it's fine const breakpointStyles = rawProps[b] || {} const r = style(breakpointStyles, activeBreakpoints) - styles = {...styles, ...r.styles} + Object.assign(styles, r.styles || {}) } else { // @ts-ignore no index sig, it's fine delete rawProps[b]