Skip to content

React sum#4339

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

React sum#4339
balakhmei wants to merge 1 commit into
mate-academy:masterfrom
balakhmei:develop

Conversation

@balakhmei

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

Your solution is approved because it meets all core functional requirements: Sum is correctly implemented as a named export, defaults a and b to 0 when missing, and App renders all the required Sum combinations without breaking functionality. The only remaining issue is a style/checklist one: the text inside the <p> in src/App.jsx and src/components/Sum/Sum.jsx is currently composed from separate JSX expressions instead of a single interpolated string, which goes against [CHECKLIST ITEM #2]. For example, instead of Sum of {a} and {b} is {a + b}, the checklist expects {Sum of ${a} and ${b} is ${a + b}} inside the <p>.

This is not a functional blocker and does not prevent the task from being completed, so it doesn’t stop approval. However, to fully align with the checklist and improve readability, I recommend updating the paragraph content in Sum (and any similar usages in App.jsx) to use a single template string inside the tag. Overall, you did well on the behavior and props handling; just treat the string interpolation change as a small polish step for future submissions.


✨ 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
@@ -1,14 +1,13 @@
import React from 'react';
import './App.scss';
import { Sum } from './components/Sum/Sum';

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. Your current implementation matches the BAD EXAMPLE pattern with separate text and expressions; you should change it to the template string pattern shown in the GOOD 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: "[CODE STYLE] - Use string interpolation inside tag content". The current implementation Sum of {a} and {b} is {a + b} matches the BAD EXAMPLE pattern with separate pieces instead of a single interpolated string. Consider changing it to {Sum of ${a} and ${b} is ${a + b}} inside the <p> tag.

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