score:1

Accepted answer
const todoReducers = (state  = {}, action) =>{
    switch (action.type) {
        case GET_TODO:
            console.log('here ' + JSON.stringify(action));
            return {
                ...state,
                todoInfo: action.payload
            };
        case CHANGE_TODO_INFO:
            return {
                ...state,
                todoInfo: action.payload
            };
        default:
            return state;
    }
}


export default todoReducers;

score:1

handleChange = (event) => {
    const {name, value} = event.target;
    this.setState((prevState) => ({
            ...prevState,
            title: value
    }));
    
    changeTitle(value);
}

const mapDispatchToProps = (dispatch) => ({
    fetchData: () => dispatch(fetchData()),   
    changeTitle: (value) => dispatch({ type: GET_TODO, payload: value }),    
});

Related Query

More Query from same tag