1:新建activity 继承reactActivity 并复写getMainComponentName方法
2:
在rn端通过AppRegistry注册这个activity的组件
'use strict';
import React from 'react';
import ReactNative from 'react-native';
const {
AppRegistry,
Text,
} = ReactNative;
export default class third extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<Text> Welcome ! ThirdActivity !!</Text>
);
}
}
AppRegistry.registerComponent('ThirdActivity', () => third);
3:然后就可以像引入其他组件一样使用这个组件
代码:https://github.com/wuyunqiang/AndroidToRN