如何不使用Navigator空間實現跳轉頁面?

//引入 Loading頁面 主頁面 登陸頁等頁面組件 constructor(props) { super(props); this.state = { 登陸狀態: 等待檢查 }; } componentDidMount() { this.檢查登陸(); // 好比調用asyncstorage } 檢查登陸() { if(通過檢查後是已登陸狀態) { this.setState({ 登陸狀態: 已登陸 }); } else { this.setState({ 登陸狀態: 未登陸 }); } } render() { const { 登陸狀態 } = this.state; switch(登陸狀態) { case 等待檢查: return <Loading頁面 />; case 已登陸: return <主頁面 />; case 未登陸: return <登陸頁 />; } }
相關文章
相關標籤/搜索