![]() Later in this tutorial, you will implement a “time travel” feature that lets you review the game’s history and “jump back” to past moves. Immutability makes complex features much easier to implement. The result is the same but by not mutating (changing the underlying data) directly, you gain several benefits. Now `squares` is unchanged, but `nextSquares` first element is 'X' rather than `null` ![]() In the end the user sees that the upper left square has changed from empty to having a X after clicking it. This causes the value prop of the Square component with index 0 to change from null to X.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |