diff --git a/src/useCacheToken.tsx b/src/useCacheToken.tsx index fa7c831..31f98a3 100644 --- a/src/useCacheToken.tsx +++ b/src/useCacheToken.tsx @@ -61,14 +61,14 @@ export default function useCacheToken( const { salt = '' } = option; // Basic - const tokenStr = flattenToken(Object.assign({}, ...tokens)); + const mergedToken = Object.assign({}, ...tokens); + const tokenStr = flattenToken(mergedToken); const cachedToken = useGlobalCache( 'token', [salt, tokenStr], () => { - const mergedDesignToken = Object.assign({}, ...tokens); - const derivativeToken = theme.getDerivativeToken(mergedDesignToken); + const derivativeToken = theme.getDerivativeToken(mergedToken); // Optimize for `useStyleRegister` performance const tokenKey = token2key(derivativeToken, salt);