Transcript
00:00 We're gonna do a little bit more with our state and now we're gonna get into some effects as well, synchronizing the state of the world with the state of our app because our users want to be able to say, whoa, whoa, stop, I need to think about this next move. They wanna close the tab, they want to refresh the tab, whatever, and they want their game to be right there.
00:19 So we're gonna persist this and we're gonna persist it in local storage because that's what the users want, it's just right on their device. And so the trick is, we need to initialize our square state properly. We also need to keep our local storage up to date as it goes. So yeah, a couple of things you're gonna be doing,
00:38 the callback form of useState, you're also gonna be managing a useEffect that's going to write the squares into local storage and your initialization function is going to read the squares from local storage. It's gonna be a good time, so let's get into it.