Skip to content

add task solution#4277

Open
Roma-Yamshchikov wants to merge 1 commit into
mate-academy:masterfrom
Roma-Yamshchikov:develop
Open

add task solution#4277
Roma-Yamshchikov wants to merge 1 commit into
mate-academy:masterfrom
Roma-Yamshchikov:develop

Conversation

@Roma-Yamshchikov
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

Your Sum component implementation correctly handles the required functionality—it accepts a and b props with proper defaults, renders the expected text output, and uses the named export pattern. The code works as intended and produces correct results. However, there are two checklist items worth noting for improvement: 1. String interpolation style — While your current approach with separate JSX expressions {a}, {b}, and {a + b} produces correct output, the checklist recommends using template literal syntax: `Sum of ${a} and ${b} is ${a + b}`. This is a minor style preference that doesn't affect functionality but aligns with the checklist guidance in [CHECKLIST ITEM #2]. 2. Default prop verification — In your App.jsx test cases, passing explicit a={0} and b={0} differs from omitting those props entirely. To truly verify default behavior works, test cases should omit the props when testing defaults (e.g., <Sum /> for no params, <Sum a={10} /> for just one default). These are non-blocking issues since the code functions correctly. Keep up the solid work on the core implementation!


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

Footnotes

  1. Rate AI review example

Comment thread src/App.jsx
Comment on lines 4 to 5

export const App = () => (
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. The current pattern with {a}, {b}, and {a + b} spread across the text is the 'BAD EXAMPLE' pattern. Use template literals instead: {Sum of ${a} and ${b} is ${a + b}}


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. The checklist requires using string interpolation inside tag content. Change to: {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