【发布时间】:2017-12-08 09:58:35
【问题描述】:
我的代码是here
我正在接受这个course
我在点击创建按钮后添加了一个导航回员工列表的操作,但我没有导航回来。你能帮我理解我可能做错了什么吗?
这里是动作创建者文件:
import firebase from 'firebase';
import Actions from 'react-native-router-flux';
import {
EMPLOYEE_UPDATE,
EMPLOYEE_CREATE
} from './types';
export const employeeUpdate = ({ prop, value }) => {
return {
type: EMPLOYEE_UPDATE,
payload: { prop, value }
};
};
export const employeeCreate = ({ name, phone, shift }) => {
const { currentUser } = firebase.auth();
return (dispatch) => {
firebase.database().ref(`/users/${currentUser.uid}/employees`)
.push({ name, phone, shift })
.then(() => {
dispatch({ type: EMPLOYEE_CREATE });
Actions.employeeList({ type: 'reset' });
});
};
};
这是我不会离开的屏幕:
【问题讨论】:
标签: react-native redux react-native-router-flux