fix(site/src): replace misused useEffectEvent with correct patterns (#24525)

This commit is contained in:
Danielle Maywood
2026-04-20 19:52:21 +01:00
committed by GitHub
parent 7f1b9cb648
commit bf885ccc71
12 changed files with 132 additions and 131 deletions
@@ -1,4 +1,4 @@
import { type FC, useEffect, useEffectEvent } from "react";
import { type FC, useCallback, useEffect } from "react";
import { useMutation, useQuery, useQueryClient } from "react-query";
import { toast } from "sonner";
import { watchInboxNotifications } from "#/api/api";
@@ -40,7 +40,7 @@ export const NotificationsInbox: FC<NotificationsInboxProps> = ({
queryFn: () => fetchNotifications(),
});
const updateNotificationsCache = useEffectEvent(
const updateNotificationsCache = useCallback(
async (
callback: (
res: ListInboxNotificationsResponse,
@@ -57,6 +57,7 @@ export const NotificationsInbox: FC<NotificationsInboxProps> = ({
},
);
},
[queryClient],
);
useEffect(() => {
@@ -85,7 +86,7 @@ export const NotificationsInbox: FC<NotificationsInboxProps> = ({
});
return () => socket.close();
}, []);
}, [updateNotificationsCache]);
const {
mutate: loadMoreNotifications,