react-native 在任意view fragment activity中集成react
2016-03-15 21:27
543 查看
myreact= (LinearLayout) findViewById(R.id.myReact);//原生布局中的view mReactRootView = new ReactRootView((Activity)context); mReactInstanceManager = ReactInstanceManager.builder() .setApplication(((Activity) mContext).getApplication()) .setJSBundleFile(bundleFile)//设置加载文件,, 本地放一份文件。。本地实现缓存。拉接口更新此文件 .setNativeModuleCallExceptionHandler(new NativeModuleCallExceptionHandler() { @Override public void handleException(Exception e) { } }) .addPackage(new TBRnPackage()) .addPackage(new ReactImagePackage()) .setUseDeveloperSupport(false) .setInitialLifecycleState(LifecycleState.RESUMED) .build(); mReactRootView.startReactApplication(mReactInstanceManager, "BZMHA", null);//启动入口 myreact.addView(mReactRootView);//添加react布局
相关文章推荐
- React-native 调用原生组件
- react-native 调用原生模块详解
- 解决ReactNative崩溃:Can't find variable: __fbBatchedBridge
- 我在集成ReactNative过程中踩过的那些坑
- windows安装React Native开发运行环境
- windows安装React Native开发运行环境
- 需要学习的一份React-Native指南
- React setState更新数组中的某个元素Element item
- React服务器渲染
- React组件之间传值
- Electron+React+Webpack+Vscode应用桌面开发平台搭建
- React-Redux之API
- RAC(ReactiveCocoa)学习资源汇总~持续更新
- React库protypes属性
- ReactiveCocoa Tutorial – The Definitive Introduction
- ReactNative安装和使用
- react native 学习资料汇总
- React.render和reactDom.render的区别
- React框架
- [转] What is the point of redux when using react?