I am trying to install @gorhom/bottom-sheet in my react-native bare project. I have followed the instructions there, which include the instructions for installing react-native-gesture-handler
and react-native-reanimated
. After installing react-native-gesture-handler
and running my app, I see this error message in the iOS simulator (iphone 14):
react-native-gesture-handler module was not found. Make sure you're running your app on the native platform and your code is linked properly (cd ios && pod install && cd ..)
As per the instructions, I have run npm install react-native-gesture-handler
, as well as put the import in my root index.js file:
// index.js
import 'react-native-gesture-handler';
import { AppRegistry } from 'react-native';
import App from './App';
import { name as appName } from './app.json';
AppRegistry.registerComponent(appName, () => App);
I have also run pod install
in the /ios
folder. Still, I am seeing this error. I have tried:
- Following the instructions at https://docs.swmansion.com/react-native-gesture-handler/docs/installation/
- Deleting and reinstalling all node_modules, as well as ios/Pods
- Cleaning my build folder via xcode
- Running
npx react-native link react-native-gesture-handler
, which tells me thatlink
is an unknown command (no longer part of the react-native cli for my version, which is 0.71.8)
My issue is not the same as the question Error: Unable to resolve module react-native-gesture-handler
, as in that question, the issue was attempting to install react-navigation
without manually installing react-native-gesture-handler
. The solution in the question react-native-gesture-handler module was not found is also not helpful, as the issue there was that the poster had changed the app name and the config file could no longer be found, and used react-native link
with an older version of react-native to discover the issue.
I am at a loss here. It seems I have installed the module correctly and the code can very much be found in my node_modules folder. I need this dependency for both @gorham/bottomsheet
as well as react-navigation
. What am I doing wrong?
Versions:
"@gorhom/bottom-sheet": "^4.4.6",
"react": "18.2.0",
"react-native": "0.71.8",
"react-native-gesture-handler": "^2.10.2",