title: React setState mixing up objects
body: <p>My component shows a contact with firstname/lastname/etc held in an object</p>
  
  <pre><code>  getInitialState: function () {
      return ({
        contact: {},
        edit: false,
        editedContact: {}
      });
    },
  </code></pre>
  
  <p>After making ajax call, I store info in the state.contact and editedcontact</p>
  
  <pre><code>  success: function (payload) {
      that.setState({ contact: payload.result, editedContact: payload.result});
    }
  </code></pre>
  
  <p>I have a toggleEdit function to decide what I will render - either the contact view or inputs to edit the contact</p>
  
  <pre><code>  toggleEdit: function () {
      this.setState({
        edit: true,
      });
    },
  
     render: function () {
      if(!this.state.edit){
        var output = (
          &lt;div&gt;
            &lt;div className="panel panel-default"&gt;
              &lt;div className="panel-heading"&gt;{this.state.contact.firstName&lt;/div&gt;
              ...
          &lt;/div&gt;
        );
      } else {
        output = (
          &lt;span className="cancel" onClick={this.cancelEdit}&gt;Cancel&lt;/span&gt;
            &lt;form onSubmit={this.handleSubmit}&gt;
                    &lt;input className="form-control" id="first-name" type="text" onChange={this.handleChange.bind(this, "firstName")} value={this.state.editedContact.firstName}/&gt;
              ...
  </code></pre>
  
  <p>The values of the form are already synced up with my editedContact for easier user experience and onChange, they updated the editedContact</p>
  
  <pre><code>  handleChange: function (paremeter, e) {
      console.log(this.state.contact.lastName);
      console.log(this.state.editedContact.lastName);
      var editedContact = this.state.editedContact;
      editedContact[paremeter] = e.target.value;
      this.setState({editedContact: editedContact});
    }
  </code></pre>
  
  <p>My cancelEdit changes the state of edit back to true to see the contact again, but I don't understand why I'm still seeing changes made to editContact in this view. My handleChange only updates the editedContact state, NOT the contact state, so why am I seeing changes made to the contact state through the console logs?</p>