Search code examples
react-nativeexpo

How to enable auto-reloading in expo?


I've been trying to make a simple app in react native using expo, till yesterday when I saved my app.js file it automatically refreshed the app running on my phone.

But today I tried running the app it didn't reload when I save the file after making changes and I'm also getting this

new window

till yesterday all was working fine I don't know what happened today. When I click reload on the reload button it reloads but it was much easier when it was automatically refreshing every time I save.


Solution

  • Looks like you have enabled Debug mode and disabled Fast Refresh. Open the developer menu: https://docs.expo.io/workflow/debugging/#developer-menu

    iOS Device: Shake the device a little bit, or touch 3 fingers to the screen.

    iOS Simulator: Hit Ctrl-Cmd-Z on a Mac in the emulator to simulate the shake gesture, or press Cmd+D.

    Android Device: Shake the device vertically a little bit, or run adb shell input keyevent 82 in your terminal window if your device is connected via USB.

    Android Emulator: Either hit Cmd+M, or run adb shell input keyevent 82 in your terminal window.

    Then Enable Fast Refresh.

    You might want to also disable Debug Mode by selecting Stop Remote Debugging (this will improve performance and get rid of that localhost window you posted)