Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expo on iOS is constantly refreshing my React Native app on MacOS, caused by Dropbox / iCloud

I'm building a simple React Native app and using the Expo iOS app to run it. But Expo is constantly refreshing my app, making it unusable / untestable. It refreshes every few seconds, sometimes multiple times a second, when I haven't changed anything. The only times when there is enough of a break between refreshes for me to test out the app is when, in my terminal, the app decides to rebuild (Again, nothing changed) and takes a few seconds to rebuild the bundle.

I set up the app using create-react-native-app and run it with npm start -- I've changed nothing else, besides adding a few components.

I've tried quitting my IDE (Sublime) and changing to a stronger wifi network.

I'm developing on macOS Sierra 10.12.2 and running on an iPhone 6S.

like image 689
Luke Knepper Avatar asked Jul 07 '17 19:07

Luke Knepper


2 Answers

It turns out this happened because my app's code was stored inside a Dropbox folder. (The same applies to iCloud backups.)

I guess that Dropbox's / iCloud's syncing interferes with watchman or other Expo / React Native internals.

I solved the problem by removing the app's directory from my Dropbox folder.

like image 64
Luke Knepper Avatar answered Oct 10 '22 17:10

Luke Knepper


For all the people who have this problem on Mac because of iCloud downloading the folder, if you rename a folder to "tmp" then iCloud will skip it.

like image 3
Oscar Hedeby Iversen Avatar answered Oct 10 '22 17:10

Oscar Hedeby Iversen