title: How to pass useState hook to child props in functional components
body: <p>I'm trying to use the useState hook for deciding whether a modal opens or not. </p>
  
  <p>I have this in the parent component.</p>
  
  <pre class="lang-js prettyprint-override"><code>    const handleState = (e) =&gt; {
          setModalOpen(e);
      };
  
      const [ modalOpen, setModalOpen ] = useState(true);
  </code></pre>
  
  <p>and I am currently passing the hook as follows</p>
  
  <pre class="lang-js prettyprint-override"><code>    return (
          &lt;ListWrapper&gt;
              {therapies.map((e, i) =&gt; {
                  return (
                      &lt;div ref={(e) =&gt; (ref.current[i] = e)}&gt;
                          &lt;CardVertical
                              title={e.title}
                              info={e.info}
                              img={e.img}
                              imgAlt={e.imgAlt}
                              functions={[ modalOpen, handleState ]}
                          /&gt;
                      &lt;/div&gt;
                  );
              })}
              &lt;Modal
                  img={therapies[0].img}
                  imgAlt={therapies[0].imgAlt}
                  title={therapies[0].title}
                  info={therapies[0].info}
                  functions={[ modalOpen, handleState ]}
              /&gt;
          &lt;/ListWrapper&gt;
      );
  </code></pre>
  
  <p>In the modal I am getting and using the hook like this.</p>
  
  <pre class="lang-js prettyprint-override"><code>const Modal = ({ img, imgAlt, title, info, functions }) =&gt; {
      const [ open, setOpen ] = functions;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>&lt;Button
    onClick={() =&gt; {
      if (functions.modalOpen) {
          setOpen(false);
      }
    }}
  </code></pre>
  
  <p>I can read the open fine. But I cant seem to call the function.</p>
  
  <p>My idea is that I'll change the information on the modal depending on what element is clicked in the array of elements. Probably by passing more state between the elements. </p>
  
  <p>I'm thinking about maybe using context instead since somehow this feels like it's getting complicated.</p>