1.安装
npm install --save react-navigation
npm link
2.导入模块
import { createAppContainer , createStackNavigator } from 'react-navigation'
3.写一个容器
const MeList = createStackNavigator({
Me:Me
});
const AppContainer = createAppContainer(MeList)
export default class App extends Component<Props> {
render() {
return (
<View style={styles.container}>
<AppContainer />
</View>
);
}
}
export default class Me extends Component {
static navigationOptions = {
title:'Me'
};
render() {
return (
<View style={styles.container}>
<Text>欢迎进入ME</Text>
</View>
);
}
}
网友评论