fkhadra / react-on-screen

Check if a react component in the viewport
https://fkhadra.github.io/react-on-screen/
MIT License
405 stars 50 forks source link

How to check if element is only Partially Visible? #53

Open uijaswanthi opened 5 years ago

uijaswanthi commented 5 years ago

From the below example i understood that isVisible will return true even if div element visible partially because I added partialVisibility prop. But is there any way i can say if div element is partially visible or fully visible?

const YourApp = () => {
    return (
        <TrackVisibility partialVisibility>
            {({ isVisible }) => <ComponentToTrack />}
        </TrackVisibility>
    );
}