How to clear input field in Draft-js
<p>None of the demos that I've seen for Draft-js (by Facebook, built on React) show how to clear the input field after submit. For example, see this <a href="http://codepen.io/rkpasia/full/jqbrpq">code pen linked to from awesome-draft-js</a> where the value you submit remains in the input field after submit. There's also no  <a href="https://facebook.github.io/draft-js/docs/api-reference-editor-state.html#content">function in the api</a> that seems designed to do it. What I've done to achieve that is to create a new empty state on button submission like this</p>

<pre><code>onSubmit(){
this.setState({
   editorState: EditorState.createEmpty(),
})
}
</code></pre>

<p>However, since I create an empty state in the constructor when the editor is loaded like this</p>

<pre><code>  this.state = {
    editorState: EditorState.createEmpty(),
  };
</code></pre>

<p>I'm worried that I might not be doing it in the right way i.e. the previous state object might become a memory leak. Question: what is the intended way to reset the state in the above situation (i.e. button submit)</p>