You can follow along a step-by-step tutorial to build this application at https://reactjs.org/tutorial/tutorial.html, and for ease of use, you can use this GitHub directory—https://github.com/PacktPublishing/Hands-on-JavaScript-for-Python-Developers/tree/master/chapter-8/react-tic-tac-toe—for the completed example:
- Clone the repository and cd into the react-tic-tac-toe directory.
- Execute yarn start.
Don't be surprised by the new yarn command. It's a different package manager that is similar to npm.
- When yarn start is complete, it will provide you with a URL similar to http://localhost:3000/. Open it in your browser. You should see this:
Figure 8.4 – React Tic Tac Toe, starting
If you're not familiar with the game Tic Tac Toe, the logic is simple. Two players alternate marking an X or an O in a 3-by-3 grid until one player has three of their marks in a row, whether horizontally...