Skip to content

react_sum#4344

Open
142536Def wants to merge 1 commit into
mate-academy:masterfrom
142536Def:develop
Open

react_sum#4344
142536Def wants to merge 1 commit into
mate-academy:masterfrom
142536Def:develop

Conversation

@142536Def

Copy link
Copy Markdown

Sum Component

Create a Sum component accepting a and b props and rendering a paragraph with a text like Sum of 2 and 1 is 3. Replace numbers with actual
values. If the a or b props are not passed, set them to 0.

Please note: use named export (not default).

The App should contain the next Sum components:

  • a = 2 and b = 3;
  • a = -5 and b = 5;
  • just a = 10;
  • just b = 5;
  • no params at all.

Instructions

  • Install Prettier Extention and use this VSCode settings to enable format on save.
  • Implement a solution following the React task guideline.
  • Open one more terminal and run tests with npm test to ensure your solution is correct.
  • Replace <142536Def> with your Github username in the DEMO LINK and add it to the PR description.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. Rate AI review example

Comment on lines +3 to +4
<p>
Sum of {a} and {b} is {a + b}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #2: Use string interpolation inside tag content. Use template literals: {Sum of ${a} and ${b} is ${a + b}}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants