react-onscreen-component
v0.1.4
Published
Component to that makes other components aware when they are on screen (visible)
Downloads
16
Readme
React On Screen
Component to that makes other components aware when they are on screen (visible)
Usage
import OnScreen from 'react-on-screen'
const DeferredImage = (props) =>
<OnScreen>
{({isOnscreen}) => (
<img {...props} src={isOnscreen ? props.src : props.placeholderSrc}/>
)}
</OnScreen>