react_sum#4344
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your Sum component is working correctly with all required functionality implemented: proper named export, default prop values of 0 for both a and b, and accurate text output. All five required Sum instances are present in App.jsx. While there's a style preference violation ([CHECKLIST ITEM #2]) where separate JSX expressions are used instead of template literal interpolation, the component produces the correct output. Since functionality is not broken and the issue is purely stylistic, I'm approving this submission. Consider refactoring to use {`Sum of ${a} and ${b} is ${a + b}`} in future iterations for cleaner code.
✨ 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. Use template literals: {Sum of ${a} and ${b} is ${a + b}}
Sum Component
Create a
Sumcomponent acceptingaandbprops and rendering a paragraph with a text likeSum of 2 and 1 is 3. Replace numbers with actualvalues. If the
aorbprops are not passed, set them to0.Please note: use named export (not default).
The
Appshould contain the nextSumcomponents:a = 2andb = 3;a = -5andb = 5;a = 10;b = 5;Instructions
npm testto ensure your solution is correct.<142536Def>with your Github username in the DEMO LINK and add it to the PR description.