-
Notifications
You must be signed in to change notification settings - Fork 3.7k
task completed #4039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
task completed #4039
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Good work on implementing the Sum component; the core logic is correct. However, changes are needed because the current implementation doesn't fully meet the task requirements for testing default props.
In src/App.jsx, you are explicitly passing a={0} or b={0} for components that should be testing default values. The requirement is to omit these props entirely to verify that the Sum component correctly defaults them to 0 on its own. For example, you should use <Sum a={10} /> instead of <Sum a={10} b={0} />.
Additionally, in src/components/Sum/Sum.jsx, the string construction violates a project guideline. Please use a single template literal for the output, as required by [CHECKLIST ITEM #2]:
<p>{`Sum of ${a} and ${b} is ${a + b}`}</p>Please make these adjustments to fully complete the task.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
src/App.jsx
Outdated
| {/* And remove commented lines :) */} | ||
| <Sum a={2} b={3} /> | ||
| <Sum a={-5} b={5} /> | ||
| <Sum a={10} b={0} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the task description, this Sum component should only receive the a prop. The b prop should be omitted to test if its value correctly defaults to 0.
src/App.jsx
Outdated
| <Sum a={2} b={3} /> | ||
| <Sum a={-5} b={5} /> | ||
| <Sum a={10} b={0} /> | ||
| <Sum a={0} b={5} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The task requires passing only the b prop here. The a prop should be omitted to test its default value.
src/App.jsx
Outdated
| <Sum a={-5} b={5} /> | ||
| <Sum a={10} b={0} /> | ||
| <Sum a={0} b={5} /> | ||
| <Sum a={0} b={0} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Sum component should be rendered with no props at all to verify that both a and b correctly default to 0.
src/components/Sum/Sum.jsx
Outdated
| // export const Sum = () => (); | ||
| export const Sum = ({ a = 0, b = 0 }) => ( | ||
| <p> | ||
| Sum of {a} and {b} is {a + b} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item #2: 'Use string interpolation inside tag content'. The task requires using a single template literal (backticks) for constructing the output string within the <p> tag. The current approach mixes text nodes and JSX expressions.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Excellent work! I'm happy to approve this solution. You've done a great job addressing all the feedback from the previous review. The Sum component now correctly uses template literals, and App.jsx properly tests the default props by omitting them. The implementation is clean and fully satisfies all task requirements. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK - https://Staskovych.github.io/react_sum/