title: ReactJS updating state from child
body: <p>I'm using ReactJS with CoffeeScript (:</p>
  
  <p>Actually I have a component A which handle a state. A state field is passed to the child (called myChild in that example). The child needs to update some value from the parent state.</p>
  
  <p>How can I do that in the ReactJS way ?</p>
  
  <pre><code>A = React.createClass
    getInitialState: 
      mystate: {test: 1}
  
    render: -&gt;
      myChild {param: @state.mystate}
  
  
  myChild = React.createClass
    render: -&gt;
      React.DOM.div {onClick: @change}, @props.param.test
  
    change: -&gt;
      @props.param.test += 1 # WRONG WRONG WRONG
      ajax("/..../", JSON.stringify(@props.param))
        .done(@onDone).fail(...)
  
    onDone: -&gt;
      console.log "Hum..."
  </code></pre>
  
  <p>Comments:</p>
  
  <p>-@props.param.test can't be changed like that (for coherence and it's should be immutable).</p>
  
  <p>-@props.param is in fact the object inside the state of component A, thus it should be updated with @setState which is not possible since we are in the child :(</p>
  
  <p>How can I clear this to have a good ReactJS component ?</p>
  
  <p>Paul ? Will you still help me ? :D</p>