diff --git a/src/features/notifications/index.tsx b/src/features/notifications/index.tsx index 8e62ffd7f..0d9f7f608 100644 --- a/src/features/notifications/index.tsx +++ b/src/features/notifications/index.tsx @@ -104,13 +104,13 @@ const Notifications = () => { }); }; - const handleDequeueNotifications = () => { + const handleDequeueNotifications = useCallback(() => { dispatch(dequeueNotifications()); - }; + }, []); - const handleRefresh = () => { + const handleRefresh = useCallback(() => { return dispatch(expandNotifications()); - }; + }, []); useEffect(() => { handleDequeueNotifications(); diff --git a/src/features/ui/components/timeline.tsx b/src/features/ui/components/timeline.tsx index 051d18122..4db80bf90 100644 --- a/src/features/ui/components/timeline.tsx +++ b/src/features/ui/components/timeline.tsx @@ -38,9 +38,9 @@ const Timeline: React.FC = ({ const hasMore = useAppSelector(state => state.timelines.get(timelineId)?.hasMore === true); const totalQueuedItemsCount = useAppSelector(state => state.timelines.get(timelineId)?.totalQueuedItemsCount || 0); - const handleDequeueTimeline = () => { + const handleDequeueTimeline = useCallback(() => { dispatch(dequeueTimeline(timelineId, onLoadMore)); - }; + }, []); const handleScrollToTop = useCallback(debounce(() => { dispatch(scrollTopTimeline(timelineId, true));