entria-fullstack
entria-fullstack copied to clipboard
add metro.config.js to work well on workspaces
https://gist.github.com/sibelius/14d0ecdbd917959c0f7b6f1c4f81f850
more sutff here https://gist.github.com/sibelius/53b3ea832d9b0d46b7b3903c6d842b85
more sutff here https://gist.github.com/sibelius/53b3ea832d9b0d46b7b3903c6d842b85 Thanks - that is super helpful!
Although, I kept getting the error: https://reactjs.org/warnings/invalid-hook-call-warning.html
After some digging, it looks that I have multiple downloads of React - in the various node_modules
. The solution seems to be to force hoist it, so it only lives at root. I'm struggling to get this working though.
try this nohoist
on root package.json
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/react-native",
"**/react-native-*",
]
}
try this
nohoist
on root package.json"workspaces": { "packages": [ "packages/*" ], "nohoist": [ "**/react-native", "**/react-native-*", ] }
After some digging, it seemed that I had two physical versions of React on-disk. My application was using both of them, which broke hooks. I fixed this by adding the following to my root:
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/react",
"**/react/**"
]
}