парни, почему у меня после экшена дело до редьюсера так и не доходит?
код прилагаю
import * as types from '../constants/ActionTypes'
const initialState = {
name: null,
surname: null,
email: null,
password: null,
isEmailRepeat: false,
isPasswordRepeat: false,
company: null,
city: null,
employeeName: null,
employeeProfession: null,
employers: []
};
export default function sampleReducer(state = initialState, action) {
switch (action.type) {
case types.CHANGE_FIELD:
console.log(1);
return {
...state,
[action.result.field]: action.result.data
}
// case types.NEXT_STEP:
// case types.PREVIOUS_STEP:
// case types.ADD_EMPLOYEE:
// case types.REMOVE_EMPLOYEE:
default:
return state;
}
}
import * as types from '../constants/ActionTypes';
export function changeField(field, data) {
console.log(field, data);
return {
type: types.CHANGE_FIELD,
resuls: {
field,
data
}
};
}
import React, { Component } from 'react';
import { combineReducers } from 'redux';
import { Provider } from 'react-redux';
import { createStore, renderDevTools } from '../store_enhancers/devTools';
import SampleApp from './SampleApp';
import * as reducers from '../reducers';
const reducer = combineReducers(reducers);
const store = createStore(reducer);
export default class App extends Component {
render() {
return (
<div>
<Provider store={store}>
{() => <SampleApp /> }
</Provider>
{renderDevTools(store)}
</div>
);
}
}