Allen Y
Allen Y

Reputation: 690

Expo iOS simulator doesn't automatically refresh React Native app upon code changes

I'm using Expo's iOS simulator with my React Native app. Before, it would live update / "fast refresh" when code changes were made, but it's no longer doing that. So this is not about using the Expo Go app on my phone, but rather the Simulator on my Macbook.

I've checked the shake (ctrl + cmd + Z) menu, and Fast Refresh is still enabled. Running npx expo run:ios does correctly reflect the latest code, but that takes a while to run.

Any help to debug this?

Upvotes: 0

Views: 1536

Answers (2)

Brian P.
Brian P.

Reputation: 1

I had a similar issue that with fast refresh not working. Reinstalling metro was the fix for me:

  1. In package.json, remove the following lines:
    "overrides": {
    "metro": "^0.73.7",
    "metro-resolver": "^0.73.7"
  },
  1. From your project directory, reinstall metro:
    npm install metro

Upvotes: 0

Enzo Manuel Mangano
Enzo Manuel Mangano

Reputation: 686

A few days ago the same thing happened to me and it depended on how I exported the main component to App.tsx.

This one doesn't work properly:

export default () => {
  return <View/>
}

This one works:

const App = () => {
  return <View/>
}

export default App

Let me know if this helps

Upvotes: 1

Related Questions