We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7b93c3 commit f20c100Copy full SHA for f20c100
src/lib/RootTheme/useRootTheme.ts
@@ -1,4 +1,4 @@
1
-import {useCallback, useRef} from 'react';
+import {useCallback, useMemo, useRef} from 'react';
2
import type {CSSProperties} from 'react';
3
import type {ThemeType} from 'css-vars-hook';
4
@@ -49,7 +49,7 @@ export const useRootTheme = (
49
themeRef.current = nextTheme;
50
}, []);
51
52
- const style = createStyleObject(themeRef.current);
+ const style = useMemo(() => createStyleObject(themeRef.current), []);
53
54
return {
55
/** Effect to apply new theme to the application */
0 commit comments