Skip to content

First task Solution - #4414

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

First task Solution#4414
jkumorek01 wants to merge 1 commit into
mate-academy:masterfrom
jkumorek01:develop

Conversation

@jkumorek01

Copy link
Copy Markdown

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

The code is approved because the core functionality works correctly and all required Sum component instances are properly implemented in App.jsx. While the Sum component has two checklist violations (prop destructuring pattern and template literal usage in paragraph content), these are style/convention issues rather than functional blockers - the code will pass the required tests. The issues are noted for your awareness: the Sum component receives props via a calculate parameter object instead of destructuring {a, b} directly, and uses separate JSX expressions instead of template literal syntax ({Sum of ${a} and ${b} is ${a + b}}). These are good practices to adopt for cleaner React code, but they don't prevent the task from being completed successfully.


✨ 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 +7 to +8
<Sum a={2} b={3} />
<Sum a={-5} 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 violates checklist item #2: 'Use string interpolation inside tag content'. The paragraph should use template literal: {Sum of ${a} and ${b} is ${a + b}}

Comment thread src/App.jsx
@@ -1,14 +1,13 @@
import React from 'react';
import './App.scss';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Props should be destructured using standard React pattern: ({ a, b }) instead of receiving a single calculate parameter object.

@@ -1 +1,11 @@
// export const Sum = () => ();
export const Sum = calculate => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Use destructuring for props: ({ a, b }) instead of receiving a single parameter. This is the standard React pattern for accessing named props.


return (
<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 template literals inside the tag content: {Sum of ${a} and ${b} is ${a + b}} instead of separate expressions.

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