title: How to dynamically add class in react?
body: <p>In simple tic-tac game,When someone wins, highlight the three squares that caused the win.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p data-height="265" data-theme-id="0" data-slug-hash="PQyERJ" data-default-tab="js,result" data-user="akshgods" data-embed-version="2" data-pen-title="Simple tic tac game" class="codepen"&gt;See the Pen &lt;a href="https://codepen.io/akshgods/pen/PQyERJ/"&gt;Simple tic tac game&lt;/a&gt; by ganesh (&lt;a href="https://codepen.io/akshgods"&gt;@akshgods&lt;/a&gt;) on &lt;a href="https://codepen.io"&gt;CodePen&lt;/a&gt;.&lt;/p&gt;
  &lt;script async src="https://static.codepen.io/assets/embed/ei.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>In this pen , you can see in console if you win, the winning indexes are logged. can some one update the code, and explain it?</p>