title: React component self close on button click
body: <p>I have a react component which I want to self close when I click a button that's on the component itself.</p>
  
  <p>Here's the code:</p>
  
  <pre><code>import React from 'react';
  import PropTypes from 'prop-types';
  
  const MyReactComponent = (props) =&gt; &lt;div&gt;
  
      &lt;h1&gt;TEST&lt;/h1&gt;
  
      &lt;button onClick={self close here?}&gt;Self Close&lt;/button&gt;
  
  &lt;/div&gt;
  
  export default MyReactComponent
  </code></pre>
  
  <p>How can I get the button click to close the component when I click it?</p>