Skip to content

Commit 934448a

Browse files
linxianxiafc163
andauthored
fix: dynamic sticky (#1184)
Co-authored-by: afc163 <[email protected]>
1 parent bedfc01 commit 934448a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/hooks/useSticky.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ export default function useSticky(
2626

2727
const container = getContainer() || defaultContainer;
2828

29+
const isSticky = !!sticky;
30+
2931
return React.useMemo(() => {
30-
const isSticky = !!sticky;
3132
return {
3233
isSticky,
3334
stickyClassName: isSticky ? `${prefixCls}-sticky-holder` : '',
@@ -36,5 +37,5 @@ export default function useSticky(
3637
offsetScroll,
3738
container,
3839
};
39-
}, [offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
40+
}, [isSticky, offsetScroll, offsetHeader, offsetSummary, prefixCls, container]);
4041
}

0 commit comments

Comments
 (0)