![](/img/trans.png)
[英]How to include '.jar' files in the React-native for Android?
[英]Modifying react-native files
我更改了react-native内的BaseViewManager.java文件,以使resource-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);
}
您必须从源代码构建React Native。 这是为此的教程: https : //facebook.github.io/react-native/docs/android-building-from-source.html我试过了,它有效:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.