Q:

How add item in nested array of object in redux reducer

Here is my example initial state: 
let initialState = {
    data: {
        name: 'john',
          books: [
              {
                  name: 'a',
                  price: 220
              }
          ]
    }
}

How I can add new book item to books ? 
I tried already 
return {
        ...state,
        data :{
          ...state.data,
          books:{
              ...state.data.books,
              name : state.data.books.concat(action.payload.item.name),
              price : state.data.books.concat(action.payload.item.price)
          }
      }
      };

Any idea for that?  
Important: I don't want to delete item which already in books I want to add new one with action payload

A:

You missed some braces there, especially, books is array and you are inserting new object
return {
        ...state,
        data: {
          ...state.data,
          books: [
              ...state.data.books,
              {
                  name: action.payload.item.name,
                  price: action.payload.item.price
              }
          ]
      }
};

