I have been trying to include a React native library (Local Library) to the React Native app.
So I installed it using
npm install library-path
Then I run
npm link libraryname
I can see the package in the node_modules of the mainProject. Also, in package.json, I can see the dependencies:
"dependencies": {
"react": "16.13.1",
"react-native": "0.63.2",
"react-native-first-library": "file:../react-native-first-library",
"react-native-toast-message": "^1.3.3",
"react-native-webview": "^10.8.3"
},
react-native-first-library is my react module.
I have done
- Clear watchman watches: watchman watch-del-all
- Delete node_modules: rm -rf node_modules and run yarn install
- Reset Metro's cache: yarn start --reset-cache
- Remove the cache: rm -rf /tmp/metro-*
But still, it is not working. I don't know why these things are so complex.