-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
solution #2701
base: master
Are you sure you want to change the base?
solution #2701
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.
good 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! 🎉 The code is mostly well-structured and functional. Just a small suggestion: consider validating the event.target.value
before casting it to the Filters
enum to prevent potential runtime errors. Keep up the good work and happy coding! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
<TodoFilter | ||
query={query} | ||
setQuery={setQuery} | ||
status={status} |
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 the value from event.target.value
is a valid Filters
enum before setting the state. This can prevent potential runtime errors if the value is not one of the expected enum values.
<select | ||
data-cy="statusSelect" | ||
value={status} | ||
onChange={event => setStatus(event.target.value as Filters)} |
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.
Casting event.target.value
directly to Filters
can lead to runtime errors if the value is not a valid Filters
enum. Consider validating the value or using a type-safe approach to ensure it matches one of the enum values.
https://so3r.github.io/react_dynamic-list-of-todos/