solution#3731
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
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 +1,19 @@ | |||
| // export const Person = ({ person }) => (); | |||
| export const Person = ({ person }) => { | |||
There was a problem hiding this comment.
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;
| @@ -1,5 +1,6 @@ | |||
| import React from 'react'; | |||
There was a problem hiding this comment.
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.
DEMO LINK