First, add stepNumber: 0 to the initial state in Game’s constructor: Next, we’ll define the jumpTo method in Game to update that stepNumber. The Visual Studio Code editor supports React.js IntelliSense and code navigation out of the box. You might be tempted to skip it because you’re not building games — but give it a chance. React is a popular JavaScript library developed by Facebook for building web application user interfaces. In addition to the updated counts, a human reading this would probably say that we swapped Alexa and Ben’s ordering and inserted Claudia between Alexa and Ben. Because React cannot know our intentions, we need to specify a key property for each list item to differentiate each list item from its siblings. To check for a winner, we’ll maintain the value of each of the 9 squares in one location. getElementById ( ' app ' ) render ( < InertiaApp initialPage = { JSON . This detection requires the mutable object to be compared to previous copies of itself and the entire object tree to be traversed. In this step, we will create DemoForm.js component file and we will write code of form validation. We now need to fix an obvious defect in our tic-tac-toe game: the “O”s cannot be marked on the board. React is used to build user interfaces (UI) on the front end. You’ve just “passed a prop” from a parent Board component to a child Square component. If we were displaying data from a database, Alexa, Ben, and Claudia’s database IDs could be used as keys. This gives the Game component full control over the Board’s data, and lets it instruct the Board to render previous turns from the history. Here’s a review of how this is achieved: The DOM