title: Reusable Modal Component React Typescript
body: <p>I have a component which has a button within it, like so -</p>
  <pre><code>&lt;Button variant=&quot;primary&quot; disabled={checkAccepted} onClick={openModal}&gt;Send&lt;/Button&gt;
  </code></pre>
  <p>I would like this button to, when it is active, to open up a modal when clicked. I am unsure how to do this and have been messing around with props but can't seem to figure it out. I also want the modal to be reusable so that any content can be passed in the modal body.I am thinking how do I open up the modal from within my openModal function?
  I tried returning it like so -</p>
  <pre><code>const openModal = () =&gt; {
  
  return (
              &lt;Modal&gt;
                  &lt;ModalBody&gt;*Pass in swappable content here*&lt;/ModalBody&gt;
              &lt;/Modal&gt;
          )
  }
  </code></pre>
  <p>But that doesn't seem to work. I am sure I am missing something.</p>