add task solution#4247
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation correctly fulfills all core functional requirements. The Sum component properly accepts a and b props with default values of 0, uses named export, renders the correct output format, and the App component contains all five required Sum instances. The code works as expected for all test cases. While there are two checklist style items noted (components should be on a single line when they have ≤2 attributes in App.jsx, and the output text in Sum.jsx should use template literal syntax), these are formatting/style preferences rather than functional blockers. The functionality is solid and meets the task requirements.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| // export const Sum = () => (); | ||
| export const Sum = ( {a = 0, b = 0} ) => { | ||
| return ( | ||
| <p>Sum of {a} and {b} is {a + b}</p> |
There was a problem hiding this comment.
This violates checklist item #2: 'Use string interpolation inside tag content'. The paragraph content should use template literals (``) with ${} syntax instead of separate JSX expressions.
GOOD EXAMPLE: <p>{Sum of ${a} and ${b} is ${a + b}}</p>
| <p>Sum of 0 and 0 is 0</p> | ||
| {/* Replace paragraphs with Sum componets */} | ||
| {/* And remove commented lines :) */} | ||
| <Sum a={2} b={3}/> |
There was a problem hiding this comment.
This violates checklist item #1: Write tags with < 3 attributes on a single line. Components with 1-2 attributes should be written as: <Sum a={2} b={3} />
| {/* Replace paragraphs with Sum componets */} | ||
| {/* And remove commented lines :) */} | ||
| <Sum a={2} b={3}/> | ||
| <Sum a={-5} b={5}/> |
There was a problem hiding this comment.
This violates checklist item #1: Write tags with < 3 attributes on a single line.
| {/* And remove commented lines :) */} | ||
| <Sum a={2} b={3}/> | ||
| <Sum a={-5} b={5}/> | ||
| <Sum a={10}/> |
There was a problem hiding this comment.
This violates checklist item #1: Write tags with < 3 attributes on a single line.
| <Sum a={2} b={3}/> | ||
| <Sum a={-5} b={5}/> | ||
| <Sum a={10}/> | ||
| <Sum b={5}/> |
There was a problem hiding this comment.
This violates checklist item #1: Write tags with < 3 attributes on a single line.
| <Sum a={-5} b={5}/> | ||
| <Sum a={10}/> | ||
| <Sum b={5}/> | ||
| <Sum/> |
There was a problem hiding this comment.
This violates checklist item #1: Write tags with < 3 attributes on a single line.
| @@ -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 template literal string interpolation inside tag content. Replace with: <p>{Sum of ${a} and ${b} is ${a + b}}</p>
No description provided.