Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to add the items from a array of JSON objects to an array in Reducer

if (response.status === 200) {
      // setData(response.data);
      dispatch({ type: "INITIALUPDATE", payload: response.data });

      setIsLoading(false);

      return;
    } else {
      throw new Error("Failed to fetch users");
    }
 
PREVIOUS NEXT
Tagged: #How #add #items #array #JSON #objects #array #Reducer
ADD COMMENT
Topic
Name
4+2 =