Skip to content

React sum#4207

Open
nazarg74 wants to merge 4 commits intomate-academy:masterfrom
nazarg74:master
Open

React sum#4207
nazarg74 wants to merge 4 commits intomate-academy:masterfrom
nazarg74:master

Conversation

@nazarg74
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

Changes are needed before this solution can be considered complete, because the current App.jsx implementation breaks both compilation and the required usage pattern of the Sum component. In src/App.jsx around lines 6–10, you render <Sum /> multiple times but never import it, which triggers the ESLint react/jsx-no-undef error and a runtime ReferenceError: Sum is not defined; you should add a named import at the top such as import { Sum } from './components/Sum/Sum';. The third Sum usage in App.jsx currently passes both a and b, but the task requires that instance to be rendered with just a = {10}, so you need to remove the b prop there. Similarly, the fourth Sum usage explicitly passes a={0} along with b={5}, while the requirement is to render that instance with just b = {5} and rely on the default a = 0, so the explicit a prop should be removed. The Sum component itself in src/components/Sum/Sum.jsx looks good: it uses a named export, defaults a and b to 0, renders inside a <p>, and uses string interpolation as required. Once you import Sum correctly and adjust those two prop usages to match the exact specification, the app should compile cleanly and align with the task’s 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
<p>Sum of 0 and 0 is 0</p>
{/* Replace paragraphs with Sum componets */}
{/* And remove commented lines :) */}
<Sum a={2} b={3} />
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 Sum component is used here but not imported in this file. Add a named import for the component (for example: import { Sum } from './components/Sum/Sum';) so the JSX compiles and uses the exported Sum.

Comment thread src/App.jsx
{/* And remove commented lines :) */}
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} />
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 line violates the core requirement 'just a = 10' — currently you pass both a and b. Remove the b prop so this Sum is rendered with only a={10}.

Comment thread src/App.jsx
<Sum a={2} b={3} />
<Sum a={-5} b={5} />
<Sum a={10} />
<Sum 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 line violates the core requirement 'just b = 5' — currently you pass a={0} explicitly. Remove the a prop so this Sum is rendered with only b={5} (you can rely on the default a = 0).

@nazarg74 nazarg74 closed this Apr 16, 2026
@nazarg74 nazarg74 reopened this Apr 16, 2026
@nazarg74 nazarg74 closed this Apr 16, 2026
@nazarg74 nazarg74 reopened this Apr 16, 2026
@nazarg74
Copy link
Copy Markdown
Author

Done

Copy link
Copy Markdown

@vitalii-bondarenko-ua vitalii-bondarenko-ua left a comment

Choose a reason for hiding this comment

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

Looks good

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.

3 participants