react_sum#4268
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
The implementation has critical task requirement violations that must be fixed before approval.
Issue 1 - Critical: The task explicitly requires "just a = 10" and "just b = 5" test cases, meaning only one prop should be passed to test default value handling. Currently in src/App.jsx:
- Line 9 passes
<Sum a={10} b={0} />— but passingb={0}explicitly defeats the purpose of testing defaults - Line 10 passes
<Sum a={0} b={5} />— but passinga={0}explicitly defeats the purpose of testing defaults
Fix required: Change to <Sum a={10} /> and <Sum b={5} /> to let the component's default values (a and b default to 0) handle the missing props.
Issue 2 - Minor Style: After fixing Issue 1, these will become single-prop tags so the checklist #1 formatting concern (2 attributes on one line) will resolve itself.
The Sum component logic and default value implementation are correct — the test cases just need to match the actual requirements.
✨ 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
| {/* 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.
This violates task requirement: 'just a = 10'. The requirement means only pass prop a, not b. Currently passing both a={10} and b={0}, but should be <Sum a={10} /> to test default value handling for b.
| <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.
This violates task requirement: 'just b = 5'. The requirement means only pass prop b, not a. Currently passing both a={0} and b={5}, but should be <Sum b={5} /> to test default value handling for a.
| {/* 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.
This violates checklist item #1: Tags with 2 attributes should not be written on one line unless the values are short. The tag has 2 attributes (a and b) and is on one line. Per the bad/good example in checklist, this should be written as:
<Sum
a={10}
b={0}
/>OR better yet, fix the logic issue first and remove b={0} entirely.
| <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.
This violates checklist item #1: Tags with 2 attributes should not be written on one line unless the values are short. The tag has 2 attributes (a and b) and is on one line. Per the bad/good example in checklist, this should be written as:
<Sum
a={0}
b={5}
/>OR better yet, fix the logic issue first and remove a={0} entirely.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is approved. The Sum component correctly handles default values for both parameters, uses a named export as required, and renders the sum using template literals in the specified format. All five test cases in App.jsx are properly implemented, including the edge cases for default value handling (passing only one prop or no props at all). The code follows the style guidelines with single-line formatting for tags with fewer than three attributes. Great work on meeting all checklist requirements!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.