Skip to content

react_sum#4268

Open
gadyka08-lab wants to merge 2 commits into
mate-academy:masterfrom
gadyka08-lab:develop
Open

react_sum#4268
gadyka08-lab wants to merge 2 commits into
mate-academy:masterfrom
gadyka08-lab:develop

Conversation

@gadyka08-lab
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Review Summary

The implementation has critical task requirement violations that must be fixed before approval.

Issue 1 - Critical: The task explicitly requires "just a = 10" and "just b = 5" test cases, meaning only one prop should be passed to test default value handling. Currently in src/App.jsx:

  • Line 9 passes <Sum a={10} b={0} /> — but passing b={0} explicitly defeats the purpose of testing defaults
  • Line 10 passes <Sum a={0} b={5} /> — but passing a={0} explicitly defeats the purpose of testing defaults

Fix required: Change to <Sum a={10} /> and <Sum b={5} /> to let the component's default values (a and b default to 0) handle the missing props.

Issue 2 - Minor Style: After fixing Issue 1, these will become single-prop tags so the checklist #1 formatting concern (2 attributes on one line) will resolve itself.

The Sum component logic and default value implementation are correct — the test cases just need to match the actual requirements.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread src/App.jsx Outdated
{/* And remove commented lines :) */}
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
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 task requirement: 'just a = 10'. The requirement means only pass prop a, not b. Currently passing both a={10} and b={0}, but should be <Sum a={10} /> to test default value handling for b.

Comment thread src/App.jsx Outdated
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />
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 task requirement: 'just b = 5'. The requirement means only pass prop b, not a. Currently passing both a={0} and b={5}, but should be <Sum b={5} /> to test default value handling for a.

Comment thread src/App.jsx Outdated
{/* And remove commented lines :) */}
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
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 #1: Tags with 2 attributes should not be written on one line unless the values are short. The tag has 2 attributes (a and b) and is on one line. Per the bad/good example in checklist, this should be written as:

<Sum
  a={10}
  b={0}
/>

OR better yet, fix the logic issue first and remove b={0} entirely.

Comment thread src/App.jsx Outdated
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />
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 #1: Tags with 2 attributes should not be written on one line unless the values are short. The tag has 2 attributes (a and b) and is on one line. Per the bad/good example in checklist, this should be written as:

<Sum
  a={0}
  b={5}
/>

OR better yet, fix the logic issue first and remove a={0} entirely.

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Review Summary

Your implementation is approved. The Sum component correctly handles default values for both parameters, uses a named export as required, and renders the sum using template literals in the specified format. All five test cases in App.jsx are properly implemented, including the edge cases for default value handling (passing only one prop or no props at all). The code follows the style guidelines with single-line formatting for tags with fewer than three attributes. Great work on meeting all checklist requirements!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

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