fix: dev ssr (#39069)

* fix: dev ssr

* chore: code clean
pull/39077/head
MadCcc 2 years ago committed by GitHub
parent 5310a0fa0c
commit def280b6a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -55,11 +55,6 @@ export const DesignTokenContext = React.createContext<{
}>(defaultConfig);
// ================================== Hook ==================================
// In dev env, we refresh salt per hour to avoid user use this
// Note: Do not modify this to real time update which will make debug harder
const saltPrefix =
process.env.NODE_ENV === 'production' ? version : `${version}-${new Date().getHours()}`;
export function useToken(): [Theme<SeedToken, MapToken>, GlobalToken, string] {
const {
token: rootDesignToken,
@ -68,7 +63,7 @@ export function useToken(): [Theme<SeedToken, MapToken>, GlobalToken, string] {
components,
} = React.useContext(DesignTokenContext);
const salt = `${saltPrefix}-${hashed || ''}`;
const salt = `${version}-${hashed || ''}`;
const mergedTheme = theme || defaultTheme;

Loading…
Cancel
Save