V
V
Vanya Huk2018-04-04 10:51:04
React
Vanya Huk, 2018-04-04 10:51:04

Why is the reducer not updating the state?

component code:

setDefaultParams() {
    store.dispatch({

      type: 'UPDATE_CHANGED',
      payload: merge({}, this.state.changed, this.props._sharedData.request)

    });
  }

filterActions reducer:
export default function ( state = null, action){

  switch( action.type ){

    case "UPDATE_CHANGED" :

      return Object.assign({}, state, { filterParams : action.payload });


    default : return state;
  }

}

and CombineReducer:
import { combineReducers } from 'redux';

import filterParams from './filters/filterParams';

import filterActions from './filters/filterActions';


export default combineReducers({
  filterParams,
  filterActions
})

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question