kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Stop re-rendering the ScrollTopButton so much
rodzic
460a6e14c3
commit
74c231b59b
|
@ -104,13 +104,13 @@ const Notifications = () => {
|
|||
});
|
||||
};
|
||||
|
||||
const handleDequeueNotifications = () => {
|
||||
const handleDequeueNotifications = useCallback(() => {
|
||||
dispatch(dequeueNotifications());
|
||||
};
|
||||
}, []);
|
||||
|
||||
const handleRefresh = () => {
|
||||
const handleRefresh = useCallback(() => {
|
||||
return dispatch(expandNotifications());
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
handleDequeueNotifications();
|
||||
|
|
|
@ -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));
|
||||
|
|
Ładowanie…
Reference in New Issue