fkhadra / fkhadra/react-on-screen
Provide API to check if another component is visible
Open
- Dominant language
- JavaScript
- Stars
- 402
- Forks
- 50
- PR merge metrics
- No merged PRs in 30d
Description
I'd like to scroll to a component only when it is not visible. I wish this module provided a way to perform a check for component without wrapping it.
```js
import TrackVisibility from 'react-on-screen';
export const scrollTo = (component) => {
if (TrackVisibility.isComponentOnScreen(component)) {
return;
}
scrollToComponent(component);
};
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.