add task solution#3837
Conversation
goffa-exe
commented
Aug 28, 2025
- DEMO LINK
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Decision: REQUEST_CHANGES
Your Sum component is generally well-structured and uses defaults correctly—nice job there. However, there are critical blockers in App.jsx that violate required checklist items and prevent the task from being considered complete.
Critical issues to fix
-
src/App.jsx (all five instances)
- Issue: All
Sumusages pass bothaandbas strings (e.g.,a="2" b="3"). This violates checklist item #1 and can produce incorrect behavior. Props must be numbers, not strings. - Why: The requirement explicitly states to pass numeric values and to render exactly five instances with specific prop combinations, including cases with only
a, onlyb, and no props. - How to fix:
- Use numeric props:
a={2}, nota="2". - Render exactly these five instances on a single line each:
a={2} b={3}a={-5} b={5}a={10}(nob)b={5}(noa)- no props:
<Sum />
- Use numeric props:
- Examples:
- Use
<Sum a={10} />instead of<Sum a="10" b="..." />. - Use
<Sum b={5} />instead of<Sum a="..." b="5" />. - Include
<Sum />with no props.
- Use
- Issue: All
-
src/components/Sum/Sum.jsx
- Issue: The paragraph builds the sentence with multiple JSX expressions instead of one template literal. This violates checklist item #2.
- Why: The checklist requires a single string interpolation expression inside the paragraph content for clarity and consistency.
- How to fix: Use one template literal in the JSX paragraph, for example:
Sum of ${a} and ${b} is ${Number(a) + Number(b)}inside a single{}.
Minor notes
- Keep each
Sumusage on one line when there are fewer than three short attributes (you’re already close here; just correct the values/props as above).
You’re close—fixing the prop passing in App.jsx and using a single interpolation in Sum.jsx will fully align your solution with the requirements. Keep it up!
✨ 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
| <p>Sum of 0 and 0 is 0</p> | ||
| {/* Replace paragraphs with Sum componets */} | ||
| {/* And remove commented lines :) */} | ||
| <Sum a="2" b="3" /> |
There was a problem hiding this comment.
This violates checklist item #1: 'In App, render exactly five Sum component instances with the following props: ... a = 10 only (no b prop), b = 5 only (no a prop), no props at all.' All Sum components here have both a and b props, and all values are passed as strings instead of numbers. You must:
- Pass numeric values (e.g., a={2}, not a="2")
- Provide instances with only a, only b, and no props as required.
| {/* Replace paragraphs with Sum componets */} | ||
| {/* And remove commented lines :) */} | ||
| <Sum a="2" b="3" /> | ||
| <Sum a="-5" b="5" /> |
There was a problem hiding this comment.
This violates checklist item #1: 'In App, render exactly five Sum component instances with the following props: ... a = 10 only (no b prop), b = 5 only (no a prop), no props at all.' All Sum components here have both a and b props, and all values are passed as strings instead of numbers. You must:
- Pass numeric values (e.g., a={-5}, not a="-5")
- Provide instances with only a, only b, and no props as required.
| {/* 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: 'In App, render exactly five Sum component instances with the following props: ... a = 10 only (no b prop), b = 5 only (no a prop), no props at all.' This instance should be (no b prop), but both a and b are provided as strings.
| <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: 'In App, render exactly five Sum component instances with the following props: ... a = 10 only (no b prop), b = 5 only (no a prop), no props at all.' This instance should be (no a prop), but both a and b are provided as strings.
| <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 checklist item #1: 'In App, render exactly five Sum component instances with the following props: ... a = 10 only (no b prop), b = 5 only (no a prop), no props at all.' This instance should be (no props at all), but both a and b are provided as strings.
| // export const Sum = () => (); | ||
| export const Sum = ({ a = 0, b = 0 }) => ( | ||
| <p> | ||
| Sum of {a} and {b} is {Number(a) + Number(b)} |
There was a problem hiding this comment.
This violates checklist item #2: 'Use string interpolation inside the paragraph’s JSX content to compose the sentence in one expression, e.g., {Sum of ${a} and ${b} is ${a + b}}, rather than concatenating multiple JSX fragments.'
You should use a single string interpolation expression inside the paragraph, such as:
<p>{`Sum of ${a} and ${b} is ${Number(a) + Number(b)}`}</p>
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Decision: APPROVE
Your implementation fully meets the requirements:
- The
Sumcomponent is a named export, acceptsaandbwith default values of0, and renders the exact text format inside a single template literal within a<p>tag. App.jsxcorrectly renders all five requiredSumusages on single lines, passing numeric props as numbers (e.g.,a={2}), and covers both, onlya, onlyb, and neither cases.
No critical blockers or functional issues were found. Nice job keeping the code concise and readable. If you want a tiny polish, the Number(a)/Number(b) conversions in Sum are unnecessary given numeric defaults, but they don’t cause any problems. Great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨