Skip to content

Conversation

@lolkinetzky
Copy link

it's all in the title holy cow ty

Copy link

@jmaddox19 jmaddox19 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up until Wave 3, everything looks good!
It looks like you didn't have time to figure out what was going wrong with wave 3. I'm glad you just submitted what you had!

setPlayer(PLAYER_1);
}

const winner = winnerIs();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We really need a piece of state for winner so that weird things don't happen with this variable.


const onClickCallback = (clickedSquare) => {
const newSquares = [];
if (winner !== '') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to issues that are arising because the winner isn't tracked as part of the state, this is triggering as true after the first move because the function returns null when there's no winner while this code is looking for an empty string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants