title: How to unmount, unrender or remove a component, from itself in a React/Redux/Typescript notification message
body: <p>I know this question has been asked a couple of times already but most of the time, the solution is to handle this in the parent, as the flow of responsibility is only descending. However, sometimes, you need to kill a component from one of its methods.
  I know I can't modify its props, and If I start adding booleans as the state, it's gonna start to be really messy for a simple component. Here is what I'm trying to achieve :
  A small error box component, with an &quot;x&quot; to dismiss it. Receiving an error through its props will display it but I'd like a way to close it from its own code.</p>
  <pre><code>class ErrorBoxComponent extends React.Component {
  
    dismiss() {
      // What should I put here?
    }
    
    render() {
      if (!this.props.error) {
        return null;
      }
  
      return (
        &lt;div data-alert className=&quot;alert-box error-box&quot;&gt;
          {this.props.error}
          &lt;a href=&quot;#&quot; className=&quot;close&quot; onClick={this.dismiss.bind(this)}&gt;&amp;times;&lt;/a&gt;
        &lt;/div&gt;
      );
    }
  }
  
  
  export default ErrorBoxComponent;
  </code></pre>
  <p>And I would use it like this in the parent component :</p>
  <pre><code>&lt;ErrorBox error={this.state.error}/&gt;
  </code></pre>
  <p>In the section  <strong>What should I put here ?</strong>, I already tried :</p>
  <p><code>ReactDOM.unmountComponentAtNode(ReactDOM.findDOMNode(this).parentNode);</code>
  Which throws a nice error in the console :</p>
  <blockquote>
  <p>Warning: unmountComponentAtNode(): The node you're attempting to unmount was rendered by React and is not a top-level container. Instead, have the parent component update its state and rerender in order to remove this component.</p>
  </blockquote>
  <p>Should I copy the incoming props in the ErrorBox state, and manipulate it only internally?</p>