Component Sum implemented - #4392
Conversation
Feature/prettier
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation successfully meets all the functional requirements for the Sum component task. The component correctly accepts a and b props with default values of 0, uses named export, renders the proper text format using template literals, and the App component contains all five required Sum instances with correct prop combinations. Code style requirements from the checklist are satisfied—components with short attributes are written on single lines and template literals are used for string interpolation. While there are minor whitespace considerations around the template literal in the <p> tag, these are stylistic preferences rather than critical issues that prevent task completion. Your solution is approved and ready for the next steps.
✨ 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.css'; | |||
| import './App.scss'; | |||
There was a problem hiding this comment.
There's a minor whitespace issue here - the space before the template literal creates leading whitespace in the output. Consider removing the space before {...} for cleaner output.
| export const Sum = ({ a = 0, b = 0 }) => ( | ||
| <p> {`Sum of ${a} and ${b} is ${a + b}`} </p> |
There was a problem hiding this comment.
Extra whitespace in the paragraph content will cause test failures. The <p> element contains leading and trailing spaces around the template literal (<p> {...} </p>), which will be rendered as actual text. Tests expect exact text match without these spaces.
https://codemasterboom.github.io/react_sum/