React native 从react native router flux上的堆栈导航中弹出
这是我的React native 从react native router flux上的堆栈导航中弹出,react-native,navigation,react-native-ios,react-navigation,react-native-router-flux,React Native,Navigation,React Native Ios,React Navigation,React Native Router Flux,这是我的路由器导航设置。我从EmployeeList导航到EmployeeCreate组件。我想在单击创建按钮时返回员工列表 <Router> <Scene key="root" hideNavBar={true}> <Scene key="auth"> <Scene key="login" component={LoginForm} title="Login" /> </Scene>
路由器导航设置
。我从EmployeeList
导航到EmployeeCreate
组件。我想在单击创建按钮时返回员工列表
<Router>
<Scene key="root" hideNavBar={true}>
<Scene key="auth">
<Scene key="login" component={LoginForm} title="Login" />
</Scene>
<Scene key="main">
<Scene
onRight={() => Actions.employeeCreate()}
rightTitle="Add"
key="employeeList"
component={EmployeeList}
title="Employee List"
initial={true}
/>
<Scene key="employeeCreate" component={EmployeeCreate} title="Employee Create"/>
</Scene>
</Scene>
</Router>
员工创建js
onButtonPress() {
const { name, phone, shift } = this.props;
this.props.employeeCreate({name, phone, shift: shift || 'Monday'});
}
export const employeeCreate = ({ name, phone, shift }) => {
return() => {
Actions.employeeCreate({ type: 'reset' });
}
};
如何调用主场景中的employeeList场景?返回到您应该使用的上一个组件
Actions.pop()
如果您需要转到您正在处理的场景组中的特定场景。可以通过在场景中定义的关键点调用场景
Actions.employeeList()
如果需要转到其他场景组,则必须调用父场景的关键点
Actions.auth()
对于“返回到上一个组件”,您应该使用
Actions.pop()
如果您需要转到您正在处理的场景组中的特定场景。可以通过在场景中定义的关键点调用场景
Actions.employeeList()
如果需要转到其他场景组,则必须调用父场景的关键点
Actions.auth()
你能ping一下创建按钮呼叫plz的代码吗?@GabrielDiez更新了。请检查nowTry Actions.pop()以返回以前的组件。谢谢还有一件事。我怎样才能回到特定的堆栈?你能ping一下创建按钮调用plz的代码吗?@GabrielDiez更新。请检查nowTry Actions.pop()以返回以前的组件。谢谢还有一件事。如何返回到特定堆栈?