Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Excellent work on this task! Your solution is functionally complete and meets all the requirements. The Sum component is well-implemented, handling both passed props and default values correctly. There's just one minor code style point to keep in mind for the future. In src/components/Sum/Sum.jsx, it's better to use a single template literal for string construction to improve readability, as noted in [CHECKLIST ITEM #2]. For example: {`Sum of ${a} and ${b} is ${a + b}`}. Since this is a minor style issue and everything works perfectly, I am approving your solution. Keep up the great work!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| 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: 'Use string interpolation inside tag content'. For better readability and to follow the project's style guide, please use a single template literal here: `{`Sum of ${a} and ${b} is ${a + b}`} `.
| @@ -1,14 +1,13 @@ | |||
| import React from 'react'; | |||
| import './App.scss'; | |||
| import { Sum } from './components/Sum/Sum'; | |||
There was a problem hiding this comment.
In the imported Sum component, the output string is constructed by mixing strings and variables. According to checklist item #2, you should use string interpolation (template literals) for this. Please refactor it to follow the 'GOOD EXAMPLE' provided in the checklist.
DEMO LINK