Skip to content
TypeScript

perf(web): the proposed plan card compiles without manual memoization (#20707)

Julius Marmingedab2d5c771e2
diff --git a/apps/web/src/components/chat/ProposedPlanCard.tsx b/apps/web/src/components/chat/ProposedPlanCard.tsx
index f448eaadf83..3f72baad200 100644
--- a/apps/web/src/components/chat/ProposedPlanCard.tsx
+++ b/apps/web/src/components/chat/ProposedPlanCard.tsx
@@ -1,5 +1,5 @@
import { proposedPlanTitle, stripDisplayedPlanMarkdown } from "@t3tools/shared/proposedPlanText";
-import { memo, useCallback, useState, useId } from "react";
+import { memo, useState, useId } from "react";
import { useFindRevealRef } from "./markdownFindContext";
import {
isAtomCommandInterrupted,
@@ -85,8 +85,7 @@ export const ProposedPlanCard = memo(function ProposedPlanCard({
// While finding, the full plan stays mounted but clipped, so a match past the
// preview can be counted and then opened only once it is selected.
const showPreview = isCollapsed && !findActive;
- const revealForFind = useCallback(() => setExpanded(true), []);
- const findRevealRef = useFindRevealRef(revealForFind);
+ const findRevealRef = useFindRevealRef(() => setExpanded(true));
const downloadFilename = buildProposedPlanMarkdownFilename(planMarkdown);
const saveContents = normalizePlanMarkdownForExport(planMarkdown);