feat: updated person object to be passes as props#3792
Conversation
mateacademy-ai-mentor
left a comment
There was a problem hiding this comment.
Review Summary
Your solution is approved because all core functional requirements are correctly implemented: the Person component renders the right details, App uses it three times with full person objects, married/unmarried logic works, and the optional age field is handled properly. The main noted issue is stylistic: in Person.jsx you combine multiple conditions directly in JSX (like person.isMarried && person.sex === 'm' && (...)), which goes against the checklist recommendation [CHECKLIST ITEM #3] to extract such conditions into named booleans for readability, but this does not break functionality. As a follow-up improvement, consider adding variables like const isMarriedMan = person.isMarried && person.sex === 'm';, const isMarriedWoman = person.isMarried && person.sex === 'f';, and const isNotMarried = !person.isMarried; above the JSX and then using {isMarriedMan && ...}, etc. Also remember to include the required demo link in your PR description (e.g. https://<your_github>.github.io/react_person/) so reviewers can quickly verify behavior. Overall, you met the task’s behavioral requirements well; refining the conditional rendering style will make your code cleaner and closer to the checklist expectations.
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Footnotes
|
updated comments |
updated person object to be passed as props