【发布时间】: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