Create Sum component#4255
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is approved. The Sum component correctly handles props with default values, renders the proper text format, uses named exports, and all five component instances in App.jsx are present with the correct props. All functional requirements pass successfully. The only issue noted is a code style violation of checklist item #2 — the paragraph text uses separate JSX expressions ({a}, {b}, {a + b}) instead of a single template literal. While this is flagged as a checklist requirement, it's a stylistic preference that doesn't affect functionality since all tests pass. The code works correctly and produces the expected output.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| import { Sum } from './components/Sum/Sum'; | ||
|
|
There was a problem hiding this comment.
This violates checklist item #2: Use string interpolation inside tag content. The text should use a template literal like {`Sum of ${a} and ${b} is ${a + b}`} instead of individual JSX expressions.
| export const Sum = ({ a = 0, b = 0 }) => ( | ||
| <p> | ||
| Sum of {a} and {b} is {a + b} |
There was a problem hiding this comment.
This uses separate JSX expressions instead of template literals. Per checklist item #2, use string interpolation: {Sum of ${a} and ${b} is ${a + b}}
DEMO LINK: https://yurii91buriak.github.io/react_sum/