Skip to content

Conversation

@Staskovych
Copy link

Copy link

@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

Good work on implementing the Sum component; the core logic is correct. However, changes are needed because the current implementation doesn't fully meet the task requirements for testing default props.

In src/App.jsx, you are explicitly passing a={0} or b={0} for components that should be testing default values. The requirement is to omit these props entirely to verify that the Sum component correctly defaults them to 0 on its own. For example, you should use <Sum a={10} /> instead of <Sum a={10} b={0} />.

Additionally, in src/components/Sum/Sum.jsx, the string construction violates a project guideline. Please use a single template literal for the output, as required by [CHECKLIST ITEM #2]:

<p>{`Sum of ${a} and ${b} is ${a + b}`}</p>

Please make these adjustments to fully complete the task.


✨ 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

src/App.jsx Outdated
{/* And remove commented lines :) */}
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />

Choose a reason for hiding this comment

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

According to the task description, this Sum component should only receive the a prop. The b prop should be omitted to test if its value correctly defaults to 0.

src/App.jsx Outdated
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />

Choose a reason for hiding this comment

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

The task requires passing only the b prop here. The a prop should be omitted to test its default value.

src/App.jsx Outdated
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />
<Sum a={0} b={0} />

Choose a reason for hiding this comment

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

This Sum component should be rendered with no props at all to verify that both a and b correctly default to 0.

// export const Sum = () => ();
export const Sum = ({ a = 0, b = 0 }) => (
<p>
Sum of {a} and {b} is {a + b}

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'. The task requires using a single template literal (backticks) for constructing the output string within the <p> tag. The current approach mixes text nodes and JSX expressions.

Copy link

@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

Excellent work! I'm happy to approve this solution. You've done a great job addressing all the feedback from the previous review. The Sum component now correctly uses template literals, and App.jsx properly tests the default props by omitting them. The implementation is clean and fully satisfies all task requirements. Keep up the great work!


✨ 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