Skip to content

Commit

Permalink
refactor: optimizing code logic
Browse files Browse the repository at this point in the history
  • Loading branch information
YumoImer committed Dec 5, 2024
1 parent be9d5a8 commit cce0256
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions src/util/genStyleUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -351,17 +351,12 @@ function genStyleUtils<
};

// Generate style for all need reset tags.
useStyleRegister(
{ ...sharedConfig, clientOnly: false, path: ['Shared', rootPrefixCls] },
() => (
typeof getResetStyles === 'function'
? getResetStyles(token, {
prefix: { rootPrefixCls, iconPrefixCls },
csp,
})
: []
),
);
if (typeof getResetStyles === 'function') {
useStyleRegister(
{ ...sharedConfig, clientOnly: false, path: ['Shared', rootPrefixCls] },
() => getResetStyles(token, { prefix: { rootPrefixCls, iconPrefixCls }, csp }),
);
}

const wrapSSR = useStyleRegister(
{ ...sharedConfig, path: [concatComponent, prefixCls, iconPrefixCls] },
Expand Down

0 comments on commit cce0256

Please sign in to comment.