Skip to content

solution#4164

Open
fedechkova wants to merge 2 commits intomate-academy:masterfrom
fedechkova:develop
Open

solution#4164
fedechkova wants to merge 2 commits intomate-academy:masterfrom
fedechkova:develop

Conversation

@fedechkova
Copy link
Copy Markdown

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

You've correctly implemented the Sum component's core logic, which is a great start! However, a couple of changes are needed to fully meet the requirements.

The primary issue is in App.jsx. The task requires testing the default props by omitting them, not by explicitly passing the default value. For instance, instead of <Sum a={10} b={0} />, it should be <Sum a={10} /> to verify that b correctly defaults to 0. Please apply this logic to the other test cases for default props as well.

Additionally, your code in Sum.jsx violates a checklist item [CHECKLIST ITEM #2]. Please use a single template literal for the text content, like <p>{`Sum of ${a} and ${b} is ${a + b}`}</p>.


✨ 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

// export const Sum = () => ();
export const Sum = ({ a = 0, b = 0 }) => (
<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'. It's better to use a single template literal for the entire string to improve readability, like {Sum of ${a} and ${b} is ${a + b}}.

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.

The task requires rendering this component with 'just a = 10' to test if the b prop correctly falls back to its default value. Please remove the explicit b={0} prop.

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.

Similar to the previous line, the requirement is to pass 'just b = 5' to verify the default value for the a prop. The a={0} prop should be omitted.

src/App.jsx Outdated
<Sum a={-5} b={5} />
<Sum a={10} b={0} />
<Sum a={0} b={5} />
<Sum a={0} 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.

To fulfill the 'no params at all' requirement, you should render the component without any props, like <Sum />. This ensures that the default values for both a and b are being used as intended.

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

Excellent work on this iteration! You have successfully addressed all the feedback from the previous review, and the code now fully aligns with all task requirements. The implementation for both the Sum component and its usage in App.jsx is clean and correct. I'm happy to approve your submission. 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