git add solution#4240
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation has critical issues that must be fixed. First, the app crashes because Sum.jsx is missing a default export — App.jsx imports it as a default import (import Sum from...) but Sum.jsx only has a named export, causing integration tests to fail entirely. Add export default Sum; at the bottom of Sum.jsx. Second, checklist violations: [CHECKLIST ITEM #1] App.jsx passes explicit a={0} and b={0} props when it shouldn't — for <Sum a={10} /> omit the b prop entirely, for <Sum b={5} /> omit the a prop, and for <Sum /> pass no props at all to test default prop handling. [CHECKLIST ITEM #2] Sum.jsx uses hardcoded JSX expressions ({a}, {b}, {a + b}) instead of the required template literal: {Sum of ${a} and ${b} is ${a + b}}. The core component logic passes unit tests, so fixing these issues should resolve everything.
✨ 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.
Checklist item #1 violation: The task requires 'just a = 10' (no b prop), but the code passes b={0} explicitly. Omit the b prop to test default prop handling.
| <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.
Checklist item #1 violation: The task requires 'just b = 5' (no a prop), but the code passes a={0} explicitly. Omit the a prop to test default prop handling.
| <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.
Checklist item #1 violation: The task requires 'no params at all', but the code passes both a={0} and b={0}. Pass no props to test default prop handling.
| import React from 'react'; | ||
| import './App.scss'; | ||
| import Sum from './components/Sum/Sum'; | ||
|
|
There was a problem hiding this comment.
Checklist item #2 violation: The checklist requires using string interpolation inside tag content. Use template literal syntax: {Sum of ${a} and ${b} is ${a + b}}
| export const Sum = ({ a = 0, b = 0 }) => { | ||
| return ( | ||
| <p> | ||
| Sum of {a} and {b} is {a + b} |
There was a problem hiding this comment.
Checklist item #2 violation: Use template literal string interpolation inside tag content. Replace with {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 correctly handles all functional requirements: the Sum component accepts a and b props with default values of 0, uses a named export, and App.jsx properly renders all five instances without passing unnecessary explicit zero props.
There is one remaining checklist item to address: checklist item #2 requires using template literal string interpolation for the output text. In src/components/Sum/Sum.jsx, change the JSX content to use a single template literal like:
<p>{`Sum of ${a} and ${b} is ${a + b}`}</p>This is a straightforward syntax adjustment that doesn't affect the component's functionality. Once you make this change, you'll have fully met all the checklist requirements. Great work on the implementation!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| 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 template literal string interpolation instead of hardcoded JSX expressions. Change to: {Sum of ${a} and ${b} is ${a + b}}
| export const Sum = ({ a = 0, b = 0 }) => { | ||
| return ( | ||
| <p> | ||
| Sum of {a} and {b} is {a + b} |
There was a problem hiding this comment.
This violates checklist item #2 which requires using string interpolation inside tag content. Replace with <p>{Sum of ${a} and ${b} is ${a + b}}</p>
No description provided.