title: How can I remove an attribute from a React component's state object
body: <p>If I have a React component that had a property set on its state:</p>
  <pre><code>onClick() {
      this.setState({ foo: 'bar' });
  }
  </code></pre>
  <p>Is it possible to remove <code>&quot;foo&quot;</code> here from <code>Object.keys(this.state)</code>?</p>
  <p>The <a href="https://facebook.github.io/react/docs/component-api.html#replacestate" rel="noreferrer">replaceState</a> method looks like the obvious method to try but it's since been deprecated.</p>