const initialState = [ {id:1, name: 'next.js', lang: 'js'}, {id:2, name: 'nuxt.js', lang: 'js'}, {id:3, name: 'nuxt.js', lang: 'js'}, {id:4, name: 'react', lang: 'js'} ] export const GlobalReducer = (state = initialState, action) => { switch (action.type) { case 'ADD_FRAMEWORK': console.log(state) return [...state, {id: 1,name:'vue', lang: 'js'}] default: return state } }