【问题标题】:Android simulator running Expo (React-Native) not showing the new code (doesn´t update)运行 Expo(React-Native)的 Android 模拟器不显示新代码(不更新)
【发布时间】:2020-04-06 04:44:54
【问题描述】:

我正在使用 expo-cli 工具在 react native 中进行开发。我正在使用 android 模拟器:一旦我运行“yarn start”,控制台就会问我:

To run the app with live reloading, choose one of:
  • Scan the QR code above with the Expo app (Android) or the Camera app (iOS).
  • Press a for Android emulator.
  • Press e to send a link to your phone with email.
  • Press s to sign in and enable more options.

我按a。模拟器成功加载 expo 应用程序,但显示的文本未更新。我的意思是,在我刚刚在 app.js 上使用它之前:

    export default function App() {
  return (
    <UtilityThemeProvider>
      <Box><Text>Hello App</Text></Box>
    </UtilityThemeProvider>
  );
}

确实显示Hello App。但后来我安装了反应导航和类似的依赖项,我在 app.js 上有这个:

   export default function App() {
  return (
    <UtilityThemeProvider>
      <Navigation />
    </UtilityThemeProvider>
  );
}

没有显示错误。不在模拟器的控制台中,不在控制台中,也不在地铁捆绑器中!但安卓模拟器仍然显示Hello App

这是我导出和导入Navigator 组件的方法:

index.js:

export default class Navigation extends Component{
    state = {}
    render(){
        return <AppNavigator />
    }
}

App.js:

import Navigation from './src/views/index'

我尝试过的事情:

  1. 重启模拟器设备 2-停止服务器并再次运行yarn start 3- 确保我的 IDE 仍处于自动保存模式

知道我能做什么吗?有没有可能我触摸了一些东西来禁用重新加载?

【问题讨论】:

    标签: react-native expo


    【解决方案1】:

    点击 Android 模拟器 Ctrl + M 并检查是否有启用 Live Reload 选项

    【讨论】:

      猜你喜欢
      • 2023-01-09
      • 2013-05-28
      • 2019-08-07
      • 2018-11-12
      • 2018-06-26
      • 1970-01-01
      • 2017-03-06
      • 1970-01-01
      • 2018-06-09
      相关资源
      最近更新 更多