Stop re-rendering the ScrollTopButton so much

This commit is contained in:
Alex Gleason
2023-10-02 12:22:09 -05:00
parent 460a6e14c3
commit 74c231b59b
2 changed files with 6 additions and 6 deletions

View File

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

View File

@ -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));