-
Notifications
You must be signed in to change notification settings - Fork 857
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
Develop #767
base: master
Are you sure you want to change the base?
Develop #767
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.
Thank you for your hard work on this pull request! 😊 While your implementation of App.tsx
is generally well-structured, there are a few critical issues that need to be addressed before we can approve it:
-
Checklist Compliance:
- Ensure that the filter in the
Autocomplete
component is not triggered by spaces only. This is a crucial requirement that needs verification. - Avoid direct DOM manipulation in the
Autocomplete
component to adhere to React best practices. - Check that keys are not generated on render, as this can lead to performance issues.
- Follow the naming conventions for methods as specified in the guidelines.
- Ensure that the filter in the
-
Task Description Compliance:
- Implement a debounce mechanism in the
Autocomplete
component with a customizable delay. - Ensure the component shows all people when the input is focused but empty, and displays a "No matching suggestions" message when necessary.
- Make sure the filtering logic doesn't rerun unnecessarily if the input text hasn't changed.
- Handle the selection of suggestions correctly, updating the input and closing the list.
- Ensure the selected person is passed to the
onSelected
callback and manage the display logic for the selected person appropriately.
- Implement a debounce mechanism in the
-
Missing Files:
- The
Autocomplete
component and thePerson
type are missing, which are essential for verifying the task requirements.
- The
Please address these points to ensure the functionality and requirements are fully met. Once these issues are resolved, your code will be in great shape! Keep up the great work, and don't hesitate to reach out if you have any questions or need further guidance. 🚀
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
{selectedPerson | ||
? `${selectedPerson?.name} (${selectedPerson?.born} - ${selectedPerson?.died})` | ||
: 'No selected 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.
The conditional rendering logic here is correct, but you can simplify it by removing the optional chaining (?.
) when accessing selectedPerson
properties. Since the condition selectedPerson
is already checked, selectedPerson
is guaranteed to be non-null in the true branch. Therefore, you can safely use selectedPerson.name
, selectedPerson.born
, and selectedPerson.died
without optional chaining.
DEMO LINK