Skip to content

Mate academy React Props#3848

Closed
FRANCISCOPELEGRINI wants to merge 8 commits into
mate-academy:masterfrom
FRANCISCOPELEGRINI:master
Closed

Mate academy React Props#3848
FRANCISCOPELEGRINI wants to merge 8 commits into
mate-academy:masterfrom
FRANCISCOPELEGRINI:master

Conversation

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

Decision: REQUEST_CHANGES

Your current src/App.jsx does not meet the core requirement to use the Sum component, which is a critical blocker for task completion and tests.

Critical issues to fix:

  • Line(s) in src/App.jsx where five <p> elements are rendered instead of Sum components (likely around the return of App): You must render five Sum instances with the specified props. This violates checklist item #3 that requires: “The App component must render five Sum component instances with the following props…”.
  • Missing import/usage of Sum: There is no import { Sum } from './Sum.jsx' (or wherever it’s defined) and no <Sum ... /> usages.
  • Missing Sum component implementation: The task requires a reusable Sum component that accepts numeric props a and b, defaults missing values to 0, and renders the paragraph with the computed sum. Without it, the defaulting behavior and component reuse can’t be validated.

Why this is wrong:

  • The assignment’s core goal is to demonstrate component reuse and prop defaulting. Rendering five <p> tags duplicates logic and bypasses the requirement to implement and use Sum, so tests expecting Sum will fail.

How to fix (hints):

  1. Implement and export a named Sum component (e.g., in src/Sum.jsx):
    • Accept props a and b and default them to 0 when not provided.
    • Render exactly the required paragraph text showing the sum.
  2. In src/App.jsx:
    • Import the named Sum component: import { Sum } from './Sum.jsx' (adjust path as needed).
    • Replace the five <p> lines with five <Sum /> instances using the specified props. For example: `
    • // b defaults to 0
    • // a defaults to 0
    • // both default to 0
      `

Minor improvements (optional):

  • Keep the Sum usages single-line for clarity, and ensure consistent numeric prop types.

You’ve shown solid JSX rendering of sums; now channel that into a reusable Sum component and wire it into App. You’re close—once Sum is implemented and used as required, you should be all set!


✨ 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
<p>Sum of 0 and 0 is 0</p>
{/* Replace paragraphs with Sum componets */}
{/* And remove commented lines :) */}
<p>Sum of {a} and {b} is {a + b}</p>
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 the requirement to render five instances of the Sum component with the specified props. Instead, you are rendering five

elements directly. You must import and use the Sum component as described in the task requirements and checklist item #3: 'The App component must render five Sum component instances with the following props...'.

Comment thread src/App.jsx Outdated
{/* Replace paragraphs with Sum componets */}
{/* And remove commented lines :) */}
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
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 the requirement to render five instances of the Sum component with the specified props. Instead, you are rendering five

elements directly. You must import and use the Sum component as described in the task requirements and checklist item #3: 'The App component must render five Sum component instances with the following props...'.

Comment thread src/App.jsx Outdated
{/* And remove commented lines :) */}
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
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 the requirement to render five instances of the Sum component with the specified props. Instead, you are rendering five

elements directly. You must import and use the Sum component as described in the task requirements and checklist item #3: 'The App component must render five Sum component instances with the following props...'.

Comment thread src/App.jsx Outdated
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
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 the requirement to render five instances of the Sum component with the specified props. Instead, you are rendering five

elements directly. You must import and use the Sum component as described in the task requirements and checklist item #3: 'The App component must render five Sum component instances with the following props...'.

Comment thread src/App.jsx Outdated
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
<p>Sum of {a} and {b} is {a + b}</p>
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 the requirement to render five instances of the Sum component with the specified props. Instead, you are rendering five

elements directly. You must import and use the Sum component as described in the task requirements and checklist item #3: 'The App component must render five Sum component instances with the following props...'.

@FRANCISCOPELEGRINI FRANCISCOPELEGRINI closed this by deleting the head repository Sep 3, 2025
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