Skip to content

Commit 179a9ce

Browse files
perf(web): the command palette results compile without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent a702563 commit 179a9ce

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type ResolvedKeybindingsConfig } from "@t3tools/contracts";
22
import { LegendList, type LegendListRef } from "@legendapp/list/react";
33
import { ChevronRightIcon } from "lucide-react";
4-
import { type RefObject, useCallback, useState } from "react";
4+
import { type RefObject, useState } from "react";
55
import { cn } from "~/lib/utils";
66
import { shortcutLabelForCommand } from "../keybindings";
77
import {
@@ -96,7 +96,7 @@ interface CommandPaletteVirtualizedResultsProps extends Omit<CommandPaletteResul
9696
export function CommandPaletteVirtualizedResults(props: CommandPaletteVirtualizedResultsProps) {
9797
const { listRef } = props;
9898
const [scrollFade, setScrollFade] = useState({ top: false, bottom: false });
99-
const updateScrollFade = useCallback(() => {
99+
const updateScrollFade = () => {
100100
const scrollElement = listRef.current?.getScrollableNode?.();
101101
if (!(scrollElement instanceof HTMLElement)) return;
102102
const top = scrollElement.scrollTop > 1;
@@ -105,7 +105,7 @@ export function CommandPaletteVirtualizedResults(props: CommandPaletteVirtualize
105105
setScrollFade((current) =>
106106
current.top === top && current.bottom === bottom ? current : { top, bottom },
107107
);
108-
}, [listRef]);
108+
};
109109

110110
if (props.rows.length === 0) {
111111
return <CommandPaletteEmptyState {...props} />;

0 commit comments

Comments
 (0)