Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
You've correctly implemented the Sum component's core logic, which is a great start! However, a couple of changes are needed to fully meet the requirements.
The primary issue is in App.jsx. The task requires testing the default props by omitting them, not by explicitly passing the default value. For instance, instead of <Sum a={10} b={0} />, it should be <Sum a={10} /> to verify that b correctly defaults to 0. Please apply this logic to the other test cases for default props as well.
Additionally, your code in Sum.jsx violates a checklist item [CHECKLIST ITEM #2]. Please use a single template literal for the text content, like <p>{`Sum of ${a} and ${b} is ${a + b}`}</p>.
✨ 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/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.
This violates checklist item #2: 'Use string interpolation inside tag content'. It's better to use a single template literal for the entire string to improve readability, like {Sum of ${a} and ${b} is ${a + b}}.
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.
The task requires rendering this component with 'just a = 10' to test if the b prop correctly falls back to its default value. Please remove the explicit b={0} prop.
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.
Similar to the previous line, the requirement is to pass 'just b = 5' to verify the default value for the a prop. The a={0} prop should be omitted.
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.
To fulfill the 'no params at all' requirement, you should render the component without any props, like <Sum />. This ensures that the default values for both a and b are being used as intended.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this iteration! You have successfully addressed all the feedback from the previous review, and the code now fully aligns with all task requirements. The implementation for both the Sum component and its usage in App.jsx is clean and correct. I'm happy to approve your submission. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK