缘起:
React Native出了有一段时间了,最近又有点时间,所以就打算简单了解一下。首先是IOS,React Native对IOS的支持还是很ok的。下边是代码:
NSURL *jsCodeLocation;
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios&dev=true"];
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation moduleName:@"xxx" initialProperties:nil launchOptions:nil];123
这样创建rootView放那儿都可以。跟React Native号称的“只是一个View”情况差不多。在看看Android代码:
MainActivity.java
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "LoveStudy";
}
}12345678910
MainApplication.java

本文探讨了在Android平台下,如何处理React Native的Native层Crash监控问题。通过分析源码,作者发现ReactActivity其实就是一个Demo,可以直接使用,避免了复杂的集成过程。此外,文章提到了通过修改getBundleAssetName()函数,可以实现离线包加载和动态更新,同时也对Facebook团队在React Native原生集成上的设计提出了疑问。
:Nativie层监方案&spm=1001.2101.3001.5002&articleId=113277275&d=1&t=3&u=665f5c48307c403abc0d32c2cc4b11bf)
775

被折叠的 条评论
为什么被折叠?



