Skip to content

Commit b80cd18

Browse files
perf(web): toasts compile without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit b80cd18

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

‎apps/web/src/components/ui/toast.tsx‎

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Spinner } from "~/components/ui/spinner";
55
import { Toast } from "@base-ui/react/toast";
66
import {
77
useEffect,
8-
useMemo,
98
useState,
109
type CSSProperties,
1110
type ComponentPropsWithoutRef,
@@ -420,18 +419,16 @@ function useActiveThreadRefFromRoute(): ScopedThreadRef | null {
420419
routeTarget?.kind === "draft" ? store.getDraftSession(routeTarget.draftId) : null,
421420
);
422421

423-
return useMemo(() => {
424-
if (routeTarget?.kind === "server") {
425-
return routeTarget.threadRef;
426-
}
427-
if (routeTarget?.kind === "draft" && activeDraftSession) {
428-
return {
429-
environmentId: activeDraftSession.environmentId,
430-
threadId: activeDraftSession.threadId,
431-
};
432-
}
433-
return null;
434-
}, [activeDraftSession, routeTarget]);
422+
if (routeTarget?.kind === "server") {
423+
return routeTarget.threadRef;
424+
}
425+
if (routeTarget?.kind === "draft" && activeDraftSession) {
426+
return {
427+
environmentId: activeDraftSession.environmentId,
428+
threadId: activeDraftSession.threadId,
429+
};
430+
}
431+
return null;
435432
}
436433

437434
function ThreadToastVisibleAutoDismiss({

0 commit comments

Comments
 (0)