-
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
add task solution #1731
base: master
Are you sure you want to change the base?
add task solution #1731
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 improvements suggested, such as ensuring slug
uniqueness and enhancing error messages, these don't significantly impact the functionality. Keep up the good work and consider these suggestions for future enhancements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
.then(data => { | ||
setPeople(data); | ||
}) | ||
.catch(() => setIsError(true)) |
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.
Consider providing more detailed error information to the user. Currently, the error message is generic ('Something went wrong'). If possible, include specific error details to help users understand what went wrong.
|
||
<tbody> | ||
{peopleWithParents.map(person => ( | ||
<PersonLink key={person.slug} person={person} people={people} /> |
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.
Ensure that person.slug
is a unique identifier for each person. Using non-unique keys can lead to performance issues and bugs in React. If slug
is not guaranteed to be unique, consider using a different unique identifier.
|
||
export const PersonLink: React.FC<Props> = ({ person, people }) => { | ||
const { slug } = useParams(); | ||
const isActivePerson = slug === person.slug; |
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.
Ensure that slug
is a unique and reliable identifier for each person. If slug
is not unique, it might cause unexpected behavior when determining the active person.
<td> | ||
{person.mother && isPersonInTable(person.motherName) ? ( | ||
<Link | ||
to={`/people/${person.mother.slug}`} |
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.
Ensure that person.mother.slug
is defined before using it in the to
prop. If person.mother
is null or undefined, accessing slug
will cause an error.
|
||
<td> | ||
{person.father && isPersonInTable(person.fatherName) ? ( | ||
<Link to={`/people/${person.father.slug}`}>{person.fatherName}</Link> |
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.
Ensure that person.father.slug
is defined before using it in the to
prop. If person.father
is null or undefined, accessing slug
will cause an error.
DEMO LINK