React sum#4339
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved because it meets all core functional requirements: Sum is correctly implemented as a named export, defaults a and b to 0 when missing, and App renders all the required Sum combinations without breaking functionality. The only remaining issue is a style/checklist one: the text inside the <p> in src/App.jsx and src/components/Sum/Sum.jsx is currently composed from separate JSX expressions instead of a single interpolated string, which goes against [CHECKLIST ITEM #2]. For example, instead of Sum of {a} and {b} is {a + b}, the checklist expects {Sum of ${a} and ${b} is ${a + b}} inside the <p>.
This is not a functional blocker and does not prevent the task from being completed, so it doesn’t stop approval. However, to fully align with the checklist and improve readability, I recommend updating the paragraph content in Sum (and any similar usages in App.jsx) to use a single template string inside the tag. Overall, you did well on the behavior and props handling; just treat the string interpolation change as a small polish step for future submissions.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| @@ -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. Your current implementation matches the BAD EXAMPLE pattern with separate text and expressions; you should change it to the template string pattern shown in the GOOD EXAMPLE.
| // 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: "[CODE STYLE] - Use string interpolation inside tag content". The current implementation Sum of {a} and {b} is {a + b} matches the BAD EXAMPLE pattern with separate pieces instead of a single interpolated string. Consider changing it to {Sum of ${a} and ${b} is ${a + b}} inside the <p> tag.
DEMO LINK