title: Controlled disabled button Material UI - React JS
body: <p>I have a quick question . I am trying to disable a button conditionally. Basically if something is selected from my table then i allow the button to be available otherwise it is disabled . I know that MUI expects a boolean in order to disable or enable the button so from my array i am doing a <code>forEach</code> loop and get the value of the selected . But it seems that nothing happens even thought if i have the value of the selected . Any ideas what am i doing wrong ?
  My array :</p>
  <pre><code>data: [{
   ....
   selected : true / false
   ....
  }]
  </code></pre>
  <p>My button:</p>
  <pre><code> &lt;Tooltip title='Download'&gt;
          &lt;Button
              className={classes.root}
              key='DownloadAll'
              disabled={data.forEach(element =&gt; element.selected)}
              color='primary'
              onClick={(event) =&gt; buttonOnClick()}
          &gt;
              &lt;SvgIcon
                  component={faDownload}
              /&gt;
          &lt;/Button&gt;
      &lt;/Tooltip&gt;
  </code></pre>