Skip to content

Commit f404373

Browse files
committed
Remove from the dep array
1 parent 7af07fd commit f404373

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

apps/webapp/app/routes/resources.incidents.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { ExclamationTriangleIcon } from "@heroicons/react/20/solid";
22
import { json } from "@remix-run/node";
33
import { useFetcher } from "@remix-run/react";
44
import { motion } from "framer-motion";
5-
import { useCallback, useEffect, useRef } from "react";
5+
import { useCallback, useEffect } from "react";
66
import { LinkButton } from "~/components/primitives/Buttons";
77
import { Paragraph } from "~/components/primitives/Paragraph";
88
import { Popover, PopoverContent, PopoverTrigger } from "~/components/primitives/Popover";
@@ -26,12 +26,10 @@ export async function loader() {
2626
export function IncidentStatusPanel({ isCollapsed = false }: { isCollapsed?: boolean }) {
2727
const { isManagedCloud } = useFeatures();
2828
const fetcher = useFetcher<typeof loader>();
29-
const fetcherRef = useRef(fetcher);
30-
fetcherRef.current = fetcher;
3129

3230
const fetchIncidents = useCallback(() => {
33-
if (fetcherRef.current.state === "idle") {
34-
fetcherRef.current.load("/resources/incidents");
31+
if (fetcher.state === "idle") {
32+
fetcher.load("/resources/incidents");
3533
}
3634
}, []);
3735

0 commit comments

Comments
 (0)