我想从我的减少动作文件中导航。第一个屏幕是登录屏幕,因此在单击登录按钮后将调用redux动作创建者,reduce生成新状态。因此,在执行该操作之后,我想重新调配到仪表板。
我在用
反应本机+ Redux +反应导航
登录组件文件(LoginCmp.js):
import React, { Component } from 'react';
import {
Text,
View,
ScrollView,
KeyboardAvoidingView
} from 'react-native';
import { connect } from 'react-redux';
import { fieldChange, LoginAction } from '../../actions';
import { Button, Section, Input, Alert } from '../Helpers';
LoginAction(){
const payload = {
email: this.props.email,
password: this.props.password
};
this.props.LoginAction(payload); // Action call
}
render() {
return (
<KeyboardAvoidingView
style={styles.container}
behavior="padding"
>
<View>
<ScrollView contentContainerStyle={styles.contentContainer}>
<Text style={styles.headerText}> Login </Text>
{this.alertMessage()}
<Section>
<Input
placeholder="email@gmail.com" …Run Code Online (Sandbox Code Playgroud)