Skip to content

Commit

Permalink
Merge pull request alibaba#1680 from li-jia-nan/useInViewport
Browse files Browse the repository at this point in the history
style: code style optimization
  • Loading branch information
crazylxr authored Jun 19, 2022
2 parents 6e17a1c + d661b30 commit 392f9af
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/hooks/src/useInViewport/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ function useInViewport(target: BasicTarget, options?: Options) {
(entries) => {
for (const entry of entries) {
setRatio(entry.intersectionRatio);
if (entry.isIntersecting) {
setState(true);
} else {
setState(false);
}
setState(entry.isIntersecting);
}
},
{
Expand Down

0 comments on commit 392f9af

Please sign in to comment.