Stop re-rendering the ScrollTopButton so much

environments/review-fix-tl-jum-epo4gd/deployments/4079
Alex Gleason 2023-10-02 12:22:09 -05:00
rodzic 460a6e14c3
commit 74c231b59b
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
2 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -104,13 +104,13 @@ const Notifications = () => {
});
};
const handleDequeueNotifications = () => {
const handleDequeueNotifications = useCallback(() => {
dispatch(dequeueNotifications());
};
}, []);
const handleRefresh = () => {
const handleRefresh = useCallback(() => {
return dispatch(expandNotifications());
};
}, []);
useEffect(() => {
handleDequeueNotifications();

Wyświetl plik

@ -38,9 +38,9 @@ const Timeline: React.FC<ITimeline> = ({
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));