From 8974e7730cd75b7e92a524d161f83147dcd99eea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 21 May 2026 12:17:08 +0200 Subject: [PATCH] fix(app-page): clear lint regression from per-tile Suspense scaffolding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The useMemo introduced for the timezone-aware greeting in the W-RSC per-tile Suspense pass listed [user?.timezone] as its dep array. React Compiler's preserve-manual-memoization rule rejected the literal optional-chain expression because the inferred dep is the wider 'user' object — a less-specific source than the declared property access — so the compiler refused to optimize the surrounding 1 400-line component body. Lift userTimezone into a local before the memo so the inferred dep and the declared dep agree. No behaviour change; the memo still recomputes only when the user's timezone string changes. --- src/app/page.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index ddc44bf67..e42ccc10e 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -573,9 +573,10 @@ export default function DashboardPage() { // changes when the user's timezone changes; recomputing it every // render churned the parts-array and walked the format ICU twice per // render across a 1 400-line component body. + const userTimezone = user?.timezone; const hour = useMemo( - () => (user?.timezone ? getHourForTimeZone(user.timezone) : null), - [user?.timezone], + () => (userTimezone ? getHourForTimeZone(userTimezone) : null), + [userTimezone], ); const timeGreeting = hour == null