【问题标题】:ract-native app not updating when edit the content to display编辑要显示的内容时反应本机应用程序未更新
【发布时间】:2018-10-08 11:24:44
【问题描述】:

我创建了一个 react-native 应用程序,经过大量试验后我已经执行了。但是当我编辑应用程序的内容时。我在 App 上所做的更改需要时间或不更新内容。请你帮我解决这个问题。

【问题讨论】:

  • 您是否使用状态变量来更改内容?
  • 我已经更改了代码并尝试再次执行,它没有发生。因为更改后的代码每次都必须构建捆绑器。 Windows 中没有发生这种情况。

标签: reactjs mobile native


【解决方案1】:

我知道这个问题是因为捆绑器不是每次都更新。在执行 react-native run-android 命令之前,我还必须更新捆绑包。

要更新构建,请执行以下命令

react-native bundle --platform android --dev false --entry-file index.js --捆绑输出 android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-01-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多