Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to push an object into an array in reducer

		case ADD_CATEGORY_SUCCESS:
				return { ...state,categories:[...state.categories,action.payload] ,loading: true };
 
PREVIOUS NEXT
Tagged: #push #object #array #reducer
ADD COMMENT
Topic
Name
7+7 =