add task solution#4285
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation is functionally correct - all 5 test cases pass, props with defaults are handled properly, and the named export is used correctly. However, there are style violations from the checklist that should be addressed. In src/components/Sum/Sum.jsx, the paragraph currently mixes plain text with JSX expressions {a}, {b}, and {a + b}. Per [CHECKLIST ITEM #2] and [CHECKLIST ITEM #3], this should use template literal string interpolation instead: `Sum of ${a} and ${b} is ${a + b}`. Additionally, in src/App.jsx, the Sum component tags with 2 attributes should be written on a single line per [CHECKLIST ITEM #2] (e.g., <Sum a={2} b={3} /> rather than spanning multiple lines). These are code style issues rather than functional bugs, so your solution works correctly. Run your linter to auto-fix the formatting issues, and you'll be all set!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
| <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. The content mixes plain text with JSX expressions {a}, {b}, and {a + b} instead of using a template literal like {Sum of ${a} and ${b} is ${a + b}}.
| <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 #2: When a tag has fewer than 3 attributes and short values, write it in one line. Change to <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 #2: When a tag has fewer than 3 attributes and short values, write it in one line. Change to <Sum a={-5} b={5} />
| @@ -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 #3: Use template literal string interpolation inside the tag content. Change to {Sum of ${a} and ${b} is ${a + b}}
DEMO LINK and add it to the PR description.