Skip to content

Conversation

@matheus-s-araujo
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Review Summary

Great work on this task! I am approving your solution as it correctly meets all the functional requirements. Your use of the functional update form for setCount is spot on and handles the batched updates perfectly.

As a minor style suggestion, and to meet the optional challenge, you could write your addOne and add100 functions more concisely using an arrow function's implicit return:

const addOne = () => setCount(c => c + 1);
const add100 = () => setCount(c => c + 100);

This is just a stylistic tip for future reference. Excellent job!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment on lines 7 to 17
const addOne = () => {
// write code here
setCount(currentCount => {
return currentCount + 1;
});
};

const add100 = () => {
// write code here
setCount(currentCount => {
return currentCount + 100;
});
};

Choose a reason for hiding this comment

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

Both addOne and add100 are implemented correctly. As a style suggestion, and to meet the optional challenge, you could write these more concisely using an arrow function's implicit return:

const addOne = () => setCount(c => c + 1);
const add100 = () => setCount(c => c + 100);

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