Skip to content

Commit dcef43c

Browse files
Convert updateSelectionCallback to use useCallback
1 parent 160642e commit dcef43c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

extensions/ql-vscode/src/view/results/AlertTable.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,13 @@ export function AlertTable(props: AlertTableProps) {
179179
const { numTruncatedResults, sourceLocationPrefix } =
180180
resultSet.interpretation;
181181

182-
const updateSelectionCallback = (
183-
resultKey: Keys.PathNode | Keys.Result | undefined,
184-
) => {
185-
setSelectedItem(resultKey);
186-
sendTelemetry("local-results-alert-table-path-selected");
187-
};
182+
const updateSelectionCallback = useCallback(
183+
(resultKey: Keys.PathNode | Keys.Result | undefined) => {
184+
setSelectedItem(resultKey);
185+
sendTelemetry("local-results-alert-table-path-selected");
186+
},
187+
[],
188+
);
188189

189190
if (!resultSet.interpretation.data.runs?.[0]?.results?.length) {
190191
return <AlertTableNoResults {...props} />;

0 commit comments

Comments
 (0)