【问题标题】:Expo iOS simulator doesn't automatically refresh React Native app upon code changesExpo iOS 模拟器不会在代码更改时自动刷新 React Native 应用程序
【发布时间】:2023-01-09 21:42:39
【问题描述】:
我将 Expo 的 iOS 模拟器与我的 React Native 应用程序一起使用。以前,它会在代码更改时进行实时更新/“快速刷新”,但现在不再这样做了。所以这不是关于在我的手机上使用 Expo Go 应用程序,而是关于在我的 Macbook 上使用模拟器。
我已经检查了摇动(ctrl + cmd + Z)菜单,并且仍然启用了快速刷新。运行 npx expo run:ios 确实正确地反映了最新的代码,但是需要一段时间才能运行。
对调试这个有什么帮助吗?
【问题讨论】:
标签:
ios
react-native
expo
【解决方案1】:
几天前,同样的事情发生在我身上,这取决于我如何将主要组件导出到 App.tsx。
这个不能正常工作:
export default () => {
return <View/>
}
这个有效:
const App = () => {
return <View/>
}
export default App
让我知道这是否有帮助