fix: page error while route changing

This commit is contained in:
jialin
2026-04-08 18:54:06 +08:00
committed by jialin
parent 1c09cc6c8c
commit 53cd8ba00c
4 changed files with 10 additions and 6 deletions
+5 -5
View File
@@ -16,7 +16,7 @@ export default function useBodyScroll() {
instanceRef.current = window.__GPUSTACK_BODY_SCROLLER__;
};
const saveScrollHeight = React.useCallback(() => {
const saveScrollHeight = () => {
if (!bodyScroller.current) {
init();
}
@@ -27,12 +27,12 @@ export default function useBodyScroll() {
instanceRef.current?.options?.({
overflow: {
x: 'hidden',
y: 'visible'
y: 'hidden'
}
});
}, []);
};
const restoreScrollHeight = React.useCallback(() => {
const restoreScrollHeight = () => {
if (timer.current) {
clearTimeout(timer.current);
}
@@ -44,7 +44,7 @@ export default function useBodyScroll() {
}
});
}, 650);
}, []);
};
React.useEffect(() => {
init();