Skip to content

solution#3731

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

solution#3731
Kit3AWP wants to merge 1 commit into
mate-academy:masterfrom
Kit3AWP:develop

Conversation

@Kit3AWP
Copy link
Copy Markdown

@Kit3AWP Kit3AWP commented May 7, 2026

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

Your implementation correctly fulfills all functional requirements for the Person component. The component renders properly, passes the person object as a prop, conditionally displays age, and handles married/unmarried states with correct gender-based partner terminology. All tests pass as expected. However, your code does not fully follow the destructuring style guideline specified in [CHECKLIST ITEM #1]. While you destructure person from props, you're then accessing individual properties like person.name, person.age, person.sex, etc. throughout the component. The checklist requires that all used properties be destructured at the component level. To fix this, destructure the properties directly from the person object at the top of your component: javascript export const Person = ({ person }) => { const { name, age, sex, isMarried, partnerName } = person; // now use name, age, sex, etc. directly // ... }; This same pattern should be applied in src/App.jsx where you render the Person component. Since this is a style/formatting guideline rather than a functional issue, your code works correctly and meets all task requirements.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

@@ -1 +1,19 @@
// export const Person = ({ person }) => ();
export const Person = ({ person }) => {
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 #1: Use destructuring for getting access to values of props object. The properties name, age, sex, isMarried, and partnerName are accessed via person.propertyName instead of being destructured. Destructure these from the person object at the component level like: const { name, age, sex, isMarried, partnerName } = person;

Comment thread src/App.jsx
@@ -1,5 +1,6 @@
import React from 'react';
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Checklist item #1 violation: The code destructures only person from props, but then accesses individual properties (person.name, person.age, person.sex, etc.) throughout the component. According to the code style requirements, you should destructure the values you need from the person object. Consider destructuring the person properties directly in the function parameter or in the function body.

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