Skip to content

Commit 9cc6cac

Browse files
coding-iceWait
authored and
Wait
committed
refactor(useInViewport): el is not empty (alibaba#2476)
1 parent f105b07 commit 9cc6cac

File tree

1 file changed

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

1 file changed

+1
-5
lines changed

packages/hooks/src/useInViewport/index.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,7 @@ function useInViewport(target: BasicTarget | BasicTarget[], options?: Options) {
4242
},
4343
);
4444

45-
els.forEach((el) => {
46-
if (el) {
47-
observer.observe(el);
48-
}
49-
});
45+
els.forEach((el) => observer.observe(el!));
5046

5147
return () => {
5248
observer.disconnect();

0 commit comments

Comments
 (0)