Skip to content

Commit 5181e97

Browse files
perf(web): the worktree base branch picker compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit 5181e97

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎apps/web/src/components/WorktreeBaseBranchPicker.tsx‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { EnvironmentId } from "@t3tools/contracts";
22
import { ChevronDownIcon, GitBranchIcon } from "lucide-react";
3-
import { useDeferredValue, useMemo, useState } from "react";
3+
import { useDeferredValue, useState } from "react";
44

55
import { usePaginatedBranches } from "../state/queries";
66
import { useEnvironmentQuery } from "../state/query";
@@ -56,10 +56,7 @@ export function WorktreeBaseBranchPicker({
5656
resolvedActiveBranchIsRemote: selectedRef ? selectedRef.isRemote === true : null,
5757
startFromOrigin,
5858
});
59-
const branchByName = useMemo(
60-
() => new Map(branches.refs.map((branch) => [branch.name, branch])),
61-
[branches.refs],
62-
);
59+
const branchByName = new Map(branches.refs.map((branch) => [branch.name, branch]));
6360
const items = [...branchByName.keys()];
6461
const hasNextPage = branches.data?.nextCursor != null;
6562
const statusText =

0 commit comments

Comments
 (0)