The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 06:45 UTC
perf(web): toasts compile without manual memoization (#20702)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 21:48 UTC
b413396fe8c7f202a52351bc4eff2d7c88ebee2e
1 file changed
+10
-13
apps/web/src/components/ui/toast.tsx
+10
-13
@@ -5,7 +5,6 @@ import { Spinner } from "~/components/ui/spinner";
5
import { Toast } from "@base-ui/react/toast";
6
import {
7
useEffect,
8
- useMemo,
8
useState,
9
type CSSProperties,
10
type ComponentPropsWithoutRef,
@@ -420,18 +419,16 @@ function useActiveThreadRefFromRoute(): ScopedThreadRef | null {
419
routeTarget?.kind === "draft" ? store.getDraftSession(routeTarget.draftId) : null,
420
);
421
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;
432
}
433
434
function ThreadToastVisibleAutoDismiss({