title: array of objects no updates and properties are not read
body: <p>I am trying to update an array containing objects. I have consition, that if Select_Item property is not equal to Item property in Cart_Item, then a new object is pushed in Cart_Item array.</p>
  <p>If it is equal then I need to update the Cart_Item object. The update part of the code is not working and also could not read the properties in Cart_Item. The relevant code is below</p>
  <pre><code>if (this.state.Item !== this.state.Select_Item) {
        let yy = [...(this.state.Cart_Item || [])];
        let xx = {
          Price: ll,
          Item: ll3,
          Quantity: this.state.Select_Quantity,
          Total_Item_Price: ll6
        };
        yy.push(xx);
        this.setState({ Cart_Item: yy });
      } else {
        //Cart updata and add objects
        // let Cart_Item = this.state.Cart_Item;
       
        let Cart_Item = [...(this.state.Cart_Item || [])];
        var index = Cart_Item.findIndex(
          obj =&gt; obj.Item === this.state.Select_Item
        );
        Cart_Item[index].Price= ll;
        Cart_Item[index].Item = ll3;
        Cart_Item[index].Quantity = this.state.Select_Quantity;
        Cart_Item[index].Total_Item_Price = ll6;
        this.setState({ Cart_Item });
      }
  
      console.log(this.state.Cart_Item);
  </code></pre>
  <p>Also please see sandbox</p>
  <p><a href="https://codesandbox.io/s/flamboyant-meninsky-hhf1g" rel="nofollow noreferrer">https://codesandbox.io/s/flamboyant-meninsky-hhf1g</a></p>