title: React - Pass props to children
body: <p>I am trying to do a conditional statement. However, I am having difficulty passing through the props</p>
  <pre><code>const App = ({children, onConfirm}) =&gt; {
  {modalActive &amp;&amp; renderModal(() =&gt; setModalActive(false), () =&gt; { onConfirmAbort(); setModalActive(false); })}
  
   if (this.props.Enabled(&quot;True&quot;)) {
      return (
          &lt;h1&gt;hello world &lt;/h1&gt;
      );
    }
    return (
      &lt;div&gt;
          {children}
      &lt;/div&gt;
    );
  };
  </code></pre>
  <p>This will give me the error:</p>
  <pre><code>TypeError: Cannot read property 'props' of undefined.  
  </code></pre>
  <p>I am not sure how to pass props through when it is a function with children.</p>