From 7a680a2d0cabffb0e2fd534f7a946d0e6a5d7753 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 16 Oct 2026 21:34:53 -0700 Subject: [PATCH] perf(web): useHtmlRenderTheme compiles without manual memoization Co-Authored-By: Claude Opus 5.5 --- apps/web/src/hooks/useHtmlRenderTheme.ts | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/apps/web/src/hooks/useHtmlRenderTheme.ts b/apps/web/src/hooks/useHtmlRenderTheme.ts index 5b2635701543..99ac26c5724c 100644 --- a/apps/web/src/hooks/useHtmlRenderTheme.ts +++ b/apps/web/src/hooks/useHtmlRenderTheme.ts @@ -1,5 +1,5 @@ import { HTML_RENDER_DEFAULT_FONTS, htmlRenderTheme } from "@t3tools/shared/htmlRender"; -import { useMemo, useSyncExternalStore } from "react"; +import { useSyncExternalStore } from "react"; import { appearanceFontStack } from "../appearanceFonts"; import { @@ -37,18 +37,14 @@ export function useHtmlRenderTheme() { ); const sans = useClientSettings((settings) => settings.fontFamilySans); const mono = useClientSettings((settings) => settings.fontFamilyCode); - return useMemo( - () => - htmlRenderTheme( - Object.fromEntries( - Object.entries(colors).map(([role, color]) => [role, themeColorToHex(color) ?? color]), - ) as typeof colors, - resolvedTheme, - { - sans: appearanceFontStack(sans, HTML_RENDER_DEFAULT_FONTS.sans), - mono: appearanceFontStack(mono, HTML_RENDER_DEFAULT_FONTS.mono), - }, - ), - [colors, resolvedTheme, sans, mono], + return htmlRenderTheme( + Object.fromEntries( + Object.entries(colors).map(([role, color]) => [role, themeColorToHex(color) ?? color]), + ) as typeof colors, + resolvedTheme, + { + sans: appearanceFontStack(sans, HTML_RENDER_DEFAULT_FONTS.sans), + mono: appearanceFontStack(mono, HTML_RENDER_DEFAULT_FONTS.mono), + }, ); }