title: react add object to object
body: <p>in a component I have:</p>
  
  <pre><code>constructor() {
     super();
       this.state = {
       lists: [], 
       items: {}  
      };
   }
  
   handleAddList(s) {
  
      var temp= this.state.lists.slice(0,this.state.lists.length);
      temp.push(s);
  
      this.setState({lists: temp},function(){
  
      var toAdd={};
      toAdd[s]=[];
  </code></pre>
  
  <p>How do I add toAdd to this.state.items ?</p>
  
  <p>UPDATE,</p>
  
  <p>I think I got it working with the following:</p>
  
  <pre><code>var ourLists = this.states.items;
  ourlists[s] = [];
  
   and then just setState.
  </code></pre>
  
  <p>I'm having trouble understanding the basic syntax of two lines:</p>
  
  <pre><code>toAdd[s] = [];  is this just the way you specify a key value pair where the value is an array?
  </code></pre>
  
  <p>ahh, I got it.</p>