title: React clickHandler for changing useState of a class Name logs correctly on console but does not display changes on screen when rendered
body: <p>I am working on a dice roller project that changes the faces of two die on a button click. The die is both a Font Awesome icon that changes the face given a given class Name (i.e &quot;fas fa-dice-six&quot; renders the side with six dots).</p>
  <p>Here is the code I have so far for the DiceRoll component:</p>
  <pre><code>import &quot;./RollDice.css&quot;;
  import React, { useState } from &quot;react&quot;;
  import Die from &quot;../Die/Die&quot;;
  
  /**
   * @returns a parent component (rendered by App)
   * that renders the dice and a button to roll
   */
  
  const RollDice = () =&gt; {
    let sides = [&quot;one&quot;, &quot;two&quot;, &quot;three&quot;, &quot;four&quot;, &quot;five&quot;, &quot;six&quot;];
    /** sets both die faces to be one at initial render */
    let [dice, setDice] = useState({
      dieOne: &quot;one&quot;,
      dieTwo: &quot;one&quot;,
    });
  
    const handleRollClick = () =&gt; {
      /** variables for each die that generates a random number for the face */
      let randomDieOne = sides[Math.floor(Math.random() * sides.length)];
      let randomDieTwo = sides[Math.floor(Math.random() * sides.length)];
  
      /** sets the state of each die to a random number on click */
      setDice({ dieOne: randomDieOne, dieTwo: randomDieTwo });
      console.log(&quot;randomDieOne:&quot;, randomDieOne);
      console.log(&quot;randomDieTwo:&quot;, randomDieTwo);
    };
  
    return (
      &lt;div&gt;
        &lt;Die face={dice.dieOne} /&gt;
        &lt;Die face={dice.dieTwo} /&gt;
        &lt;button onClick={handleRollClick}&gt;Roll Dice&lt;/button&gt;
      &lt;/div&gt;
    );
  };
  
  export default RollDice;
  </code></pre>
  <p>Here is the code I have so far for the DiceRoll component:</p>
  <pre><code>import React, { useState } from &quot;react&quot;;
  import RollDice from &quot;../RollDice/RollDice&quot;;
  import &quot;./Die.css&quot;;
  
  /**
   * @returns an individual die that takes props and
   * displays the correct face of the die based on props
   */
  
  const Die = ({ face }) =&gt; {
    console.log(&quot;face&quot;, face);
    return (
      &lt;div className=&quot;dice die-icon&quot;&gt;
        &lt;i className={`fas fa-dice-${face}`}&gt;&lt;/i&gt;
      &lt;/div&gt;
    );
  };
  
  export default Die;
  </code></pre>
  <p>I have a handler for clicking the &quot;roll&quot; button that updates the state of the number string at the end of the icon's class Name. When I log out the updated state of the die, new random numbers are logged out, however, the changes are not rendering on the screen, meaning that the class Names for the icons are not changing when the button is clicked.</p>
  <p>Does anyone see where I may have gone wrong?</p>