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.
import TrackVisibility from 'react-on-screen';
export const scrollTo = (component) => {
if (TrackVisibility.isComponentOnScreen(component)) {
return;
}
scrollToComponent(component);
};