3.0.0 • Published 3 years ago

react-native-impressions v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-native-impressions

Track which components are visible to user

Installation

npm install react-native-impressions

Usage

import { Watcher } from "react-native-impressions"

<Watcher watchX watchY callback={({ direction, visible }) => {...}}>
   <YourComponent />
</Watcher>

Props

nametypedescription
watchXbooleanwatch only for x-axis
watchYbooleanwatch only for y-axis
callbackfunctionreturn the direction and visibility status of the component
watchIntervalnumberwatch position at this time interval in milliseconds
visiblePercentageXnumbervalid percent component visibility for x-axis
visiblePercentageYnumbervalid percent component visibility for y-axis
extraOffsetBottomnumberaddition offset to avoid other components
extraOffsetTopnumberaddition offset to avoid other components
extraOffsetRightnumberaddition offset to avoid other components
extraOffsetLeftnumberaddition offset to avoid other components