react native (1) 新建页面并跳转
新建页面
1.新建文件
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。 import React from 'react'; import { Text } from 'react-native'; export default class todayAttenScreen extends React.Component { render() { return <Text>我是个菜鸟</Text> } }2.找到navigation下的MainTabNavigator.js文件定义
(1) import todayAtten from '引入的文件路径'; (2) 在export default createStackNavigator({]);中注册并初始化路由 todayAttenScreen: {screen: todayAtten, header: null} 3.跳转 this.props.navigation.replace(' todayAttenScreen')
更多精彩