I have a project where I put a React Context code into a local module and included it using
nom install directory
The package.json
itself has the following
"devDependencies": {
"@types/react": "^16.14.2",
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0",
"axios": "^0.21.1",
"eslint": "^7.18.0",
"eslint-plugin-prettier": "^3.3.1",
"expo-secure-store": "^10.0.0",
"prettier": "2.2.1",
"react": "^16.13.1",
"react-native": "^0.63.4",
"typedoc": "^0.20.19",
"typedoc-plugin-mermaid": "^1.3.0",
"typescript": "^4.1.3"
},
"peerDependencies": {
"axios": "axios^0.17.0 || axios^0.19.0 || ^0.21.1",
"expo-secure-store": "^9.0.0 || ^10.0.0",
"react-native": "^0.62.0 || ^0.63.0"
},
"dependencies": {},
What happens is if I install the local module, Expo will be building it and at runtime there would be two Reacts. I already did a npm prune --production
on the folder but it seems to always include it.
My workaround for now is to not add the dependency and instead import the local module with ../local_module/...
Is there some sort of setting I am missing?
Read more here: https://stackoverflow.com/questions/65919401/how-do-you-prevent-expo-from-using-devdependencies
Content Attribution
This content was originally published by Archimedes Trajano at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.