fkhadra / fkhadra/react-on-screen

Provide API to check if another component is visible

Open
#44 0 comments 0 reactions 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.