Package Exports
- react-native-component-inview
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-native-component-inview) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-native-component-inview
A React Native wrapper to check whether a component is in the view port to track impressions and clicks

Installation
npm i --save react-native-component-inview # npm syntax
yarn add react-native-component-inview --save # yarn syntaxExample
import InView from 'react-native-component-inview'
const [isInView, setIsInView] = useState(false)
const checkVisible = (isVisible:boolean) => {
if (isVisible){
setIsInView(isVisible)
} else {
setIsInView(isVisible)
}
}
<ScrollView>
<InView onChange={(isVisible) => this.checkVisible(isVisible)}>
<View style={[styles.item, {backgroundColor: isInView ? 'yellow' : '#f9c2ff'}]}>
<Text>yay</Text>
</View>
</InView>
</ScrollView>