我换了一个BaseViewManager。react native内部的java文件,使资源id通过react native可用。问题是,无论我做什么,任何事情都不会生效,即使我在.java文件中输入了拼写错误。我的同事告诉我这可能是因为.java没有被构建。
那么如何构建react-native.java文件呢??
当然,我尝试了npm启动,但没有任何效果。
这是我想更改的代码
@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);
}