Compare commits

..

No commits in common. "9d10556a4eafe5f39e396b4ab3a31ad0beaf87cd" and "8b8acb3ee71797a8da775603dbdaae4f6c99f861" have entirely different histories.

2 changed files with 5 additions and 9 deletions

View File

@ -80,13 +80,10 @@ export const UIStateProvider = ({ children }: { children: ReactNode }) => {
}, []);
const setScrollPosition = useCallback((key: string, position: number) => {
setScrollPositions((prev) => {
if (prev[key] === position) return prev;
return {
...prev,
[key]: position,
};
});
setScrollPositions((prev) => ({
...prev,
[key]: position,
}));
}, []);
const value = useMemo(

View File

@ -15,6 +15,5 @@ export const useScrollPersistence = (key: string) => {
return () => {
setScrollPosition(key, window.scrollY);
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [key, setScrollPosition]);
}, [key, setScrollPosition, scrollPositions]); // eslint-disable-next-line react-hooks/exhaustive-deps
};