About The Project
For when you need to make "click away" or "click outside" interactions in react native.
This package contains a provider that publishes all touch events to consuming hooks and has utilities to figure out if a user clicked inside a node. And is written in Typescript.
npm i react-native-touch-tracker
yarn add react-native-touch-tracker
Add the provider
Place the provider as high as possible in your tree probably in
<TouchTrackerProvider /> renders a view you probably need to add some style like flex: 1 to keep it from messing up your style.
Place the hook in a component that needs to be aware of all touches:
You can make use of the utilities to detect if a click was inside or outside
Distributed under the unlicense License. See
LICENSE for more information.