add solution#3835
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Decision: REQUEST_CHANGES
Your implementation is close, but there are two critical blockers that violate explicit checklist items and likely test expectations.
-
Critical issues to fix:
- src/App.jsx
- Issue (Checklist #1): The 3rd, 4th, and 5th usages of
Sumpass explicit zeros instead of omitting props.- Lines (approx): where you have
\<Sum a={10} b={0} />,\<Sum a={0} b={5} />, and\<Sum a={0} b={0} />. - Why: The requirement states to render exactly:
\<Sum a={10} />,\<Sum b={5} />, and\<Sum />so that defaults are exercised and tests can match expected usage. - How to fix: Remove the unnecessary props:
- 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 />
- Change
- Lines (approx): where you have
- Issue (Checklist #1): The 3rd, 4th, and 5th usages of
- src/components/Sum/Sum.jsx
- Issue (Checklist #2): The
<p>content is built with multiple expressions instead of a single string interpolation.- Lines (approx): the
<p>that rendersa,b, anda + bseparately. - Why: The requirement mandates a single interpolation block for readability and to satisfy tests.
- How to fix: Use one template literal:
{Sum of ${a} and ${b} is ${a + b}}inside the<p>.
- Lines (approx): the
- Issue (Checklist #2): The
- src/App.jsx
-
What you did well:
- Correct named exports and clean component structure.
- Proper defaulting of
aandbto 0, ensuring robustness.
Please make these quick adjustments and resubmit. You’re very close—nice work so far!
✨ 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 checklist item #1: 'In App, render the Sum component five times with the following props: ... a={10} only (no b prop), b={5} only (no a prop), no props at all'. You should render <Sum a={10} />, <Sum b={5} />, and <Sum /> instead of passing explicit zeros for missing props.
| <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 the Sum component five times with the following props: ... a={10} only (no b prop), b={5} only (no a prop), no props at all'. You should render <Sum a={10} />, <Sum b={5} />, and <Sum /> instead of passing explicit zeros for missing props.
| <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 the Sum component five times with the following props: ... a={10} only (no b prop), b={5} only (no a prop), no props at all'. You should render <Sum a={10} />, <Sum b={5} />, and <Sum /> instead of passing explicit zeros for missing props.
| // 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 to form the sentence within a single interpolation block, not by concatenating multiple expressions or split literals.' Consider using a single template literal expression inside the
tag, e.g., {Sum of ${a} and ${b} is ${a + b}}.
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Decision: APPROVE
Your implementation fully meets the task requirements. The Sum component uses named export, defaults a and b to 0, and renders exactly: Sum of {a} and {b} is {a + b} in a single <p>. In App.jsx, you render the five required <Sum> instances with the correct props on single lines, and the import uses named syntax. There are no critical issues or blockers; functionality and formatting are correct.
Nice work keeping the code clean and concise. You're good to proceed!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
DEMO LINK