Reset React State with a Button and Function in our Tic-Tac-Toe Game

Share this video with your friends

Send Tweet

Our tic-tac-toe board works and can be played, but it can't be reset once the game is won or the board is full. Adding this is simple. We'll add another case to our reducer and use a function to regenerate the initialState of our game.

Andy
Andy
~ 3 years ago

I like simple state: https://codereview.stackexchange.com/questions/252111/tic-tac-toe-in-react-official-tutorial/252805#252805 what are your thoughts?

Andy
Andy
~ 3 years ago

Why I did my state different: https://redux.js.org/style-guide/style-guide#keep-state-minimal-and-derive-additional-values