Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Move estimateSize outside of component body
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Feb 27, 2024
1 parent 7a7ba0e commit a3cd77f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/taskQueue/TaskQueueTable/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -22,6 +22,7 @@ interface TaskQueueTableProps {
taskQueue: TaskQueueColumnData[];
taskId?: string;
}
const estimateSize = () => 65;

const TaskQueueTable: React.FC<TaskQueueTableProps> = ({
taskId,
Expand All @@ -36,7 +37,6 @@ const TaskQueueTable: React.FC<TaskQueueTableProps> = ({
[],
);

const estimateSize = useCallback(() => 65, []);
const table = useLeafyGreenTable<TaskQueueColumnData>({
data: taskQueue,
columns,
Expand All @@ -58,6 +58,7 @@ const TaskQueueTable: React.FC<TaskQueueTableProps> = ({
table.scrollToIndex(i, { align: "center" });
}, 200);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [taskId, taskQueue]);

return (
Expand Down

0 comments on commit a3cd77f

Please sign in to comment.