-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solve #1736
base: master
Are you sure you want to change the base?
solve #1736
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job on implementing the task requirements! 🎉 While there are a few minor issues, such as the use of person.name
as a key and potential confusion with nested routes, these do not critically impact the functionality. Consider addressing these in future iterations for improved code quality. Keep up the good work! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<Route path="people"> | ||
<Route index element={<People />} /> | ||
<Route path=":peopleId" element={<People />} /> | ||
</Route> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nested routes under /people
might cause confusion. The People
component is used for both the index route and the :peopleId
route. Ensure that the People
component can handle both cases appropriately, or consider using different components if they serve different purposes.
<tr | ||
key={person.name} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using person.name
as a key might not be unique if there are multiple people with the same name. Consider using a unique identifier, such as person.slug
or another unique property, to ensure that each element has a unique key.
father: peopleFromServer.find(p => p.name === person.fatherName), | ||
mother: peopleFromServer.find(p => p.name === person.motherName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for finding a person's father and mother by name may lead to incorrect associations if there are multiple people with the same name. Consider using a unique identifier for each person to ensure accurate parent-child relationships.
|
||
<tbody> | ||
{people.map(person => ( | ||
<PersonLink key={person.name} person={person} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using person.name
as a key might not be unique if there are multiple people with the same name. Consider using a unique identifier, such as person.slug
or another unique property, to ensure that each element has a unique key.
DEMO LINK