From a3cd77ff2ed4f51d201f6594c081bfaa4c9b81fa Mon Sep 17 00:00:00 2001 From: Mohamed Khelif Date: Tue, 27 Feb 2024 16:51:40 -0500 Subject: [PATCH] Move estimateSize outside of component body --- src/pages/taskQueue/TaskQueueTable/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/taskQueue/TaskQueueTable/index.tsx b/src/pages/taskQueue/TaskQueueTable/index.tsx index bc2f02a4f7..66d38db0f4 100644 --- a/src/pages/taskQueue/TaskQueueTable/index.tsx +++ b/src/pages/taskQueue/TaskQueueTable/index.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useEffect, useMemo, useRef, useState } from "react"; import styled from "@emotion/styled"; import Badge from "@leafygreen-ui/badge"; import { css } from "@leafygreen-ui/emotion"; @@ -22,6 +22,7 @@ interface TaskQueueTableProps { taskQueue: TaskQueueColumnData[]; taskId?: string; } +const estimateSize = () => 65; const TaskQueueTable: React.FC = ({ taskId, @@ -36,7 +37,6 @@ const TaskQueueTable: React.FC = ({ [], ); - const estimateSize = useCallback(() => 65, []); const table = useLeafyGreenTable({ data: taskQueue, columns, @@ -58,6 +58,7 @@ const TaskQueueTable: React.FC = ({ table.scrollToIndex(i, { align: "center" }); }, 200); } + // eslint-disable-next-line react-hooks/exhaustive-deps }, [taskId, taskQueue]); return (