Reactjs 如何在另一个函数中调用动作。[场景名称]?
我有个问题。 如何调用Reactjs 如何在另一个函数中调用动作。[场景名称]?,reactjs,react-native,Reactjs,React Native,我有个问题。 如何调用login函数中的Actions.Home()函数。 Actions.home()是react-native-router-flux操作的一部分,应该切换到另一个场景,这可以正常工作,但我不能在登录函数中调用它 我环顾四周,没有找到任何关于它的东西。 这是不可能的,还是我错过了一些显而易见的事情 async login(email, pass) { email = this.state.email, pass = this.state.password if(email
login
函数中的Actions.Home()
函数。
Actions.home()
是react-native-router-flux
操作的一部分,应该切换到另一个场景,这可以正常工作,但我不能在登录函数中调用它
我环顾四周,没有找到任何关于它的东西。
这是不可能的,还是我错过了一些显而易见的事情
async login(email, pass) {
email = this.state.email,
pass = this.state.password
if(email != '' && pass != '')
{
try {
await this.props.firebase.auth()
.signInWithEmailAndPassword(email, pass);
//this.props.navigator.push({ screen: 'Chat' });
Actions.home();
console.log("Logged In!");
} catch (error) {
console.log(error.toString())
}
}
else if (true) {
this.popup.alert('The Input fields havent been properly filled in');
}
}
你把它放在最上面了吗
import {Actions} from 'react-native-router-flux'
Yes Actions.home()不在登录函数中工作no没有错误消息它只到达Actions.home()方法,然后停止。。