Skip to content

Conversation

Aghaile
Copy link

@Aghaile Aghaile commented Jan 4, 2022

No description provided.

Comment on lines +35 to +36
// let currentPlayer = player_1;
// let winner = null;
Copy link

Choose a reason for hiding this comment

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

remove unused code

let resetBoard = generateSquares();
setCurrentPlayer(player1);
setWinner(null);
setSquares(resetBoard);
Copy link

Choose a reason for hiding this comment

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

you can just say setSquares(generateSquares())

};

const onClickCallback = (id) => {
console.log('onclick', id);
Copy link

Choose a reason for hiding this comment

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

remove console log after debugging

</header>
<main>
<Board squares={squares} />
<Board onClickCallback={boardCallback} squares={squares} />
Copy link

Choose a reason for hiding this comment

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

here you can just reference the function in the curly braces instead of making a separate variable. So onClickCallback={onClickCallback}

@tgoslee
Copy link

tgoslee commented Jan 4, 2022

Good Job Adah! I just added a few comments on what you can refactor. Also, when pushing your final code do a final walk-through of code to remove console logs and commented code.

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.

3 participants