【问题标题】:Modifying react-native files修改 react-native 文件
【发布时间】:2017-07-25 13:37:14
【问题描述】:

我更改了 react-native 中的 BaseViewManager.java 文件,以通过 react-native 提供资源 ID。问题是,无论我做什么,都不会生效,即使我在 .java 文件中输入了拼写错误。我的同事告诉我,这可能是因为 .java 尚未构建。

那么如何构建 react-native .java 文件??

我当然试过 npm start 但没有任何效果。

这是我要更改的代码

@ReactProp(name = PROP_TEST_ID)
  public void setTestId(T view, String testId) {
    view.setTag(R.id.react_test_id, testId);

    // temporarily set the tag and keyed tags to avoid end to end test regressions
    view.setTag(testId);
  }

  @ReactProp(name = PROP_NATIVE_ID)
  public void setNativeId(T view, String nativeId) {
    view.setTag(R.id.view_tag_native_id, nativeId);
    ReactFindViewUtil.notifyViewRendered(view);
}

【问题讨论】:

    标签: java android react-native ui-testing


    【解决方案1】:

    你必须从源代码构建 React Native。这是教程:https://facebook.github.io/react-native/docs/android-building-from-source.html 我试过了,它可以工作:)

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-03-21
    • 1970-01-01
    • 2016-10-11
    • 2023-02-20
    • 2017-03-20
    • 1970-01-01
    相关资源
    最近更新 更多