Initial#4282
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has two critical violations that prevent task completion. First, in src/App.jsx, the Sum component usage does not match the task requirements: you explicitly pass b={0} when it should be omitted for "just a = 10", pass a={0} when it should be omitted for "just b = 5", and pass a={0} b={0} when it should be empty for "no params at all". The purpose is to test that your Sum component's default props work correctly, which requires omitting these props entirely, not passing them explicitly. Second, the Sum component violates [CHECKLIST ITEM #2] by not using template literals - change the paragraph content to use `Sum of ${a} and ${b} is ${a + b}` instead of separate JSX expressions. Please fix both issues and resubmit.
✨ 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.
According to the task, this should be just a = 10 (only prop a, without passing b). Instead, the code explicitly passes b={0}, which doesn't test the default prop behavior as required.
| <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.
According to the task, this should be just b = 5 (only prop b, without passing a). Instead, the code explicitly passes a={0}, which doesn't test the default prop behavior as required.
| <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.
According to the task, this should be "no params at all" (empty). Instead, the code explicitly passes a={0} b={0}, which doesn't test the default prop behavior as required.
| @@ -1,14 +1,13 @@ | |||
| import React from 'react'; | |||
| import './App.scss'; | |||
| import { Sum } from './components/Sum/Sum'; | |||
There was a problem hiding this comment.
This violates Checklist Item #2: Use string interpolation inside tag content. The paragraph should use a template literal: {Sum of ${a} and ${b} is ${a + b}} instead of separate JSX expressions.
| // 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.
Checklist item #2 violation: Use template literals for string interpolation. Change to: {Sum of ${a} and ${b} is ${a + b}}
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved. All task requirements and checklist items have been satisfied: the Sum component correctly uses destructuring with default values for both a and b, renders the paragraph with template literals, and is properly exported as a named export. The App component contains all five required Sum instances with the correct props, including cases where props are entirely omitted to test default values. Both critical issues from the previous review have been successfully resolved, and no outstanding issues remain. Great work implementing the default parameter pattern correctly!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK