React Native Pointer Interactions
Expose iPad mouse & track pads interactions to React Native.
Expose iPad mouse & track pads interactions to React Native
Mostly automatic installation
1. Install the library
npm install @thefunbots/react-native-pointer-interactions --save
2. (Optional) Install react-native-swift
If you are not already using any other swift based modules in your app, install and run react-native-swift to configure your iOS project to support swift.
npm install --save react-native-swift
After installing it, you will need to link it. Requires project to use Swift 5.0 and iOS SDK 13.4+
- In XCode, in the project navigator, right click
Add Files to [your project's name]
- Go to
- In XCode, in the project navigator, select your project. Add
libRNPointerInteractions.ato your project's
Link Binary With Libraries
- Run your project (
Add this to the Info plists
Wrap the views you want to be interactable in
import PointerInteractionView from '@thefunbots/react-native-pointer-interactions';<PointerInteractionView ="lift"><Text>Hi</Text></PointerInteractionView>
Using the High Order Component
The component extends the regular View, so you can use the common properties too.
|beamLength||Sets the cursor size for Beam modes only|
If you want to play with the API but don't feel like trying it on a real app, you can run the example project. Clone the repo, go to the
example/ folder and run:
If you are running on ios, run
pod install in the ios folder
react-native start to start the metro bundler
react-native run-ios (depending on which platform you want to run the example app on).
You will need to have an iOS device or emulator connected as well as
react-native-cli package installed globally.
- It doesn't work when wrapping