epicweb-dev / react-hooks

Learn React Hooks! 🎣 ⚛
https://hooks.epicreact.dev
Other
2.78k stars 1.91k forks source link

Fix: Tic Tac Toe Winner Logic condition check #204

Closed ASPzoomin closed 1 year ago

ASPzoomin commented 1 year ago
ASPzoomin commented 1 year ago

Hmmm... Wouldn't this mean there's a winner before the game has begun? Because at the start all of those values will be empty. The first squares[a] check is to make sure that it has a value.

right but wondering in what scenario there would be a winner before the game start?

kentcdodds commented 1 year ago

I think you code makes that possible which is what I'm saying.

ASPzoomin commented 1 year ago

I think you code makes that possible which is what I'm saying.

makes sense, but we don't call checkwinner function until we click the square button my code will not make it possible in this case, but i get your point!!