title: Switch to another button depending on a condition in ReactJS
body: <p>I am working on a project in ReactJS and I have the following function:</p>
  
  <pre><code>function moveChecker() {
        let i = 0;
        let arr = [];
        while (i &lt; props.moves.length) {
            if (arr.includes(props.moves[i].moveName) === false)
                arr.push(props.moves[i].moveName);
            i++;
        return arr
        }
    }
  </code></pre>
  
  <p>It goes through an object moves and takes in all unique moveNames. Now, I also have this HTML button:</p>
  
  <pre><code>&lt;button className={`actionBoxButtonGrey ${moveChecker().includes('DiceMove') ? "actionBoxButton" : ''}`}
  </code></pre>
  
  <p>The code does not work but what I am trying is, if moveChecker().includes('DiceMove') is true, switch to the button desing actionBoxButton which is in my CSS file.</p>
  
  <p>Is there any workaround to use those conditions for a button? </p>