0.3.0 • Published 9 months ago

react-native-visibility-aware-view v0.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

react-native-visibility-aware-view

Supports iOS and Android npm

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).

Installation

npm install react-native-visibility-aware-view

Usage

import { VisibilityAwareView } from 'react-native-visibility-aware-view';

// ...

<VisibilityAwareView
  minVisibleArea={0.5}
  ignoreAppState={ignoreAppState}
  onBecomeVisible={(event) => {}}
  onBecomeInvisible={(event) => {}}
  style={styles.box}
/>;

Testing

New Arch

iOS

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

Android

Navigate to example/android/gradle.properties and set newArchEnabled=true then run

yarn clean
yarn
# and then
yarn example android
generate Artifacts
cd ./example/android
./gradlew generateCodegenArtifactsFromSchema
cd ../../
yarn example android

# or
cd ./example/android && ./gradlew generateCodegenArtifactsFromSchema && cd ../../ && yarn example android

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

0.3.0

9 months ago

0.2.0

1 year ago