Skip to content
TypeScript

perf(web): the new-thread link route compiles without manual memoization (#20597)

Julius Marmingedc060b113288
diff --git a/apps/web/src/routes/_chat.new.tsx b/apps/web/src/routes/_chat.new.tsx
index 185809097a0..8d7ff405117 100644
--- a/apps/web/src/routes/_chat.new.tsx
+++ b/apps/web/src/routes/_chat.new.tsx
@@ -1,7 +1,5 @@
import { parseNewThreadLink } from "@t3tools/shared/promptLinks";
import { createFileRoute, useLocation } from "@tanstack/react-router";
-import { useMemo } from "react";
-
import { NewThreadLinkView } from "../components/promptLinks/NewThreadLinkView";
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "../components/ui/empty";
import { SidebarInset } from "../components/ui/sidebar";
@@ -9,7 +7,7 @@ import { SidebarInset } from "../components/ui/sidebar";
// The query is read raw: the router's own search parsing turns `prompt=123` into a number.
function NewThreadLinkRoute() {
const search = useLocation({ select: (location) => location.searchStr });
- const parsed = useMemo(() => parseNewThreadLink(search), [search]);
+ const parsed = parseNewThreadLink(search);
if (!parsed.ok) {
return (
<SidebarInset className="h-dvh min-h-0 overflow-hidden overscroll-y-none">