Implement Sum component Jeverson - #4416
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
I am requesting changes because one explicit checklist requirement is not met: using a single template string interpolation inside the tag content. In both src/App.jsx and src/components/Sum/Sum.jsx, the paragraph renders multiple JSX children like Sum of {a} and {b} is {a + b} instead of a single interpolated string, which violates [CHECKLIST ITEM #2]. Please update the <p> content to a single expression using a template literal, for example: {Sum of ${a} and ${b} is ${a + b}}.
What’s done well: the Sum component is a named export, defaults a and b to 0, and App renders all five required cases. This change is small but required by the checklist and style rules. After applying this adjustment, the solution should fully meet the 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
| export function App() { | ||
| return ( |
There was a problem hiding this comment.
This violates checklist item #2: "Use string interpolation inside tag content. GOOD EXAMPLE:
{Sum of ${a} and ${b} is ${a + b}}
Sum of {a} and {b} is {a + b}) instead of a single string interpolation. Consider changing the paragraph content to use a template literal inside a single expression, e.g. {Sum of ${a} and ${b} is ${a + b}} so it matches the required style.
| // export const Sum = () => (); | ||
| export function Sum({ a = 0, b = 0 }) { | ||
| return ( | ||
| <p> |
There was a problem hiding this comment.
This doesn't follow checklist item #2: "Use string interpolation inside tag content. GOOD EXAMPLE:
{Sum of ${a} and ${b} is ${a + b}}
Sum of {a} and {b} is {a + b}) instead of a single interpolated string. Consider replacing the contents with a template string inside braces.
|
Olá! Corrigi o componente Sum para usar uma única interpolação de string com template literal, conforme solicitado no checklist. Os testes e o lint estão passando. Obrigado! |
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your implementation fully satisfies all requirements. The Sum component correctly uses a named export, defaults props to 0, and renders the sum using template literal interpolation in the specified format. The App component properly renders all five required test cases, and all component tags with fewer than 3 attributes are written on single lines as required. No critical issues or blockers were identified.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Olá! A atividade foi concluída conforme solicitado.
Implementei o componente Sum com valores padrão para as props a e b e adicionei os cinco casos solicitados no App.
Todos os testes e o lint estão passando.
DEMO LINK: https://232567.github.io/react_sum/