A view which is aware of its visibility. It also tracks itself when the view is scrolled or moved.
This library supports both architectures. The old one and fabric (new arch).
npm install react-native-visibility-aware-view
import { VisibilityAwareView } from 'react-native-visibility-aware-view';
// ...
<VisibilityAwareView
minVisibleArea={0.5}
ignoreAppState={ignoreAppState}
onBecomeVisible={(event) => {}}
onBecomeInvisible={(event) => {}}
style={styles.box}
/>;
Navigate to example/package.json and set RCT_NEW_ARCH_ENABLED=1 in pods script
then run
yarn clean
yarn
# and then
yarn example ios
Navigate to example/android/gradle.properties and set newArchEnabled=true then run
yarn clean
yarn
# and then
yarn example android
cd ./example/android
./gradlew generateCodegenArtifactsFromSchema
cd ../../
yarn example android
# or
cd ./example/android && ./gradlew generateCodegenArtifactsFromSchema && cd ../../ && yarn example android
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library