Skip to content

Commit 75d2998

Browse files
authored
fix: 修复useInViewport的rootMargin值无法使用组件state更新 (alibaba#1984)
* fix: rootMargin fix rootMargin does not update when using setState * fix: useInViewport的rootMargin值无法使用组件state更新 修复useInViewport的rootMargin值无法使用组件state更新 * fix: useInViewport的rootMargin值无法使用组件state更新 useInViewport的rootMargin值无法使用组件state更新 * fix: 添加threshold监听 添加threshold监听
1 parent d0b7793 commit 75d2998

File tree

1 file changed

+1
-1
lines changed
  • packages/hooks/src/useInViewport

1 file changed

+1
-1
lines changed

packages/hooks/src/useInViewport/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function useInViewport(target: BasicTarget, options?: Options) {
4040
observer.disconnect();
4141
};
4242
},
43-
[],
43+
[options?.rootMargin, options?.threshold],
4444
target,
4545
);
4646

0 commit comments

Comments
 (0)