The best way to control Claude Code, Codex and more from any computer or phone
perf(web): useHtmlRenderTheme compiles without manual memoization (#20642)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:58 UTC
f63f0261d1223cf59f58a288cefc2cb1f91e53f0
1 file changed
+10
-14
apps/web/src/hooks/useHtmlRenderTheme.ts
+10
-14
@@ -1,5 +1,5 @@
1
import { HTML_RENDER_DEFAULT_FONTS, htmlRenderTheme } from "@t3tools/shared/htmlRender";
2
-import { useMemo, useSyncExternalStore } from "react";
2
+import { useSyncExternalStore } from "react";
3
4
import { appearanceFontStack } from "../appearanceFonts";
5
import {
@@ -37,18 +37,14 @@ export function useHtmlRenderTheme() {
37
);
38
const sans = useClientSettings((settings) => settings.fontFamilySans);
39
const mono = useClientSettings((settings) => settings.fontFamilyCode);
40
- return useMemo(
41
- () =>
42
- htmlRenderTheme(
43
- Object.fromEntries(
44
- Object.entries(colors).map(([role, color]) => [role, themeColorToHex(color) ?? color]),
45
- ) as typeof colors,
46
- resolvedTheme,
47
- {
48
- sans: appearanceFontStack(sans, HTML_RENDER_DEFAULT_FONTS.sans),
49
- mono: appearanceFontStack(mono, HTML_RENDER_DEFAULT_FONTS.mono),
50
- },
51
- ),
52
- [colors, resolvedTheme, sans, mono],
40
+ return htmlRenderTheme(
41
+ Object.fromEntries(
42
+ Object.entries(colors).map(([role, color]) => [role, themeColorToHex(color) ?? color]),
43
+ ) as typeof colors,
44
+ resolvedTheme,
45
+ {
46
+ sans: appearanceFontStack(sans, HTML_RENDER_DEFAULT_FONTS.sans),
47
+ mono: appearanceFontStack(mono, HTML_RENDER_DEFAULT_FONTS.mono),
48
+ },
49
);
50
}