add task solution#4273
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Changes are needed to meet the task requirements and checklist item #2. There are two critical issues that need fixing: 1. App.jsx incorrectly passes explicit values instead of testing defaults — For the test cases meant to verify default parameters, you should omit the props entirely rather than passing 0. Specifically: - Change <Sum a={10} b={0} /> to <Sum a={10} /> - Change <Sum a={0} b={5} /> to <Sum b={5} /> - Change <Sum a={0} b={0} /> to <Sum /> 2. Sum.jsx violates checklist item #2 — The paragraph content must use template literal string interpolation instead of separate expressions. Change: jsx <p>{a} + {b} = {a + b}</p> to: jsx <p>{`Sum of ${a} and ${b} is ${a + b}`}</p> The first issue prevents the default parameter functionality from being properly tested, which is a core requirement. The second issue explicitly violates the style checklist you were given. Once these are corrected, your implementation should pass all 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 the task requirement: 'just a = 10 (no b prop)'. The code explicitly passes b={0} instead of omitting the b prop to test the default parameter. Change to <Sum a={10} />
| <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 the task requirement: 'just b = 5 (no a prop)'. The code explicitly passes a={0} instead of omitting the a prop to test the default parameter. Change to <Sum b={5} />
| <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.
This violates the task requirement: 'no params at all'. The code explicitly passes both props instead of omitting them to test the default parameters. Change to <Sum />
| @@ -1,14 +1,13 @@ | |||
| import React from 'react'; | |||
| import './App.scss'; | |||
| import { Sum } from './components/Sum/Sum'; | |||
There was a problem hiding this comment.
Checklist item #2 violation: Use string interpolation (template literals) inside tag content. Current code uses separate expressions instead of a template literal. Change to {Sum of ${a} and ${b} is ${a + b}}
| <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. The current implementation uses multiple JSX expressions ({a}, {b}, {a + b}), but the checklist specifies using template literals like {`Sum of ${a} and ${b} is ${a + b}`}
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is complete and correct. The Sum component properly accepts a and b props with default values of 0, uses named export, and renders the correct format using template literal string interpolation. Your App.jsx correctly includes all five test cases: (2,3), (-5,5), (10), (5), and () to test both explicit values and default parameter behavior. All checklist items are satisfied and the code passes all validations. Great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK