小编Sub*_*lik的帖子

反应导航以从Redux操作文件导航

我想从我的减少动作文件中导航。第一个屏幕是登录屏幕,因此在单击登录按钮后将调用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)

jsx react-native redux react-redux react-navigation

1
推荐指数
1
解决办法
7134
查看次数

标签 统计

jsx ×1

react-native ×1

react-navigation ×1

react-redux ×1

redux ×1