-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use library that requires native setup? #14
Comments
Hi @learnForeverr. When you add your dependency to |
Ah yes, see this file https://github.com/demchenkoalex/react-native-module-template/blob/main/example/metro.config.js and add |
Nope not working by adding there. The solution I found is to remove the reanimated from dev dependencies. Then it is working fine. But Intellisense is gone. Anyway not a problem for me. It is working thats enought. wish for @type file from reanimated would be great. Same problem was happening with react node module also. After removing them from dependency and dev-dependency worked. @type is doing its job. reanimated would be a pain. |
But I know this error - it is exactly what I sent you above. You can send me how you modified |
Yeah. Tried re-installing all. const path = require('path') const moduleRoot = path.resolve(__dirname, '..') module.exports = { Getting invalid hook error for react, because of two node modules. Need to check this file. It should ignore the other node modules |
Invalid hook for react? I import react inside library's code like this |
So I added reanimated in dependency instead of dev-dependency and it started working. with react it is still giving the hook error. But i dont need react there because @type is doing its job. So for me the error is resolved. Thanks for quick response demchenkoalex. I am working on windows just FYI. |
Thanks for letting me know! Good luck with your project :) |
Hi, I successfully setup the library it works great. but i wanted to use react-native-reanimated 2 in my own library. I added it into peer dependency. But I cannot setup its configuration for native side as its documentation tell us to do. So the reanimated code in the root src folder index.tsx gives me the error. Can someone help how to setup reanimated configuration to run in the library side code?
The text was updated successfully, but these errors were encountered: