-
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
done #2712
base: master
Are you sure you want to change the base?
done #2712
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 on implementing the task! 🎉 While there are a few minor issues, such as the naming of the hasErrorMessage
variable and the use of the key
attribute, these do not significantly impact the functionality of your code. Keep up the good work and consider the feedback for future improvements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
const [selectedTodo, setSelectedTodo] = useState<Todo | null>(null); | ||
const [filterBy, setFilterBy] = useState<FilterByState>(FilterByState.ALL); | ||
const [query, setQuery] = useState(''); | ||
const [hasErrorMessage, setErrorMessage] = useState(''); |
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 state variable hasErrorMessage
is misleadingly named. Since it holds a string message rather than a boolean, consider renaming it to errorMessage
to better reflect its purpose.
|
||
export const TodoItem: React.FC<Props> = ({ todo, onSelect, selectedTodo }) => { | ||
return ( | ||
<tr data-cy="todo" className="" key={todo.id}> |
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.
Avoid using the key
attribute directly on the tr
element during render. Instead, pass the key
prop to the TodoItem
component from the parent component, such as TodoList
, to ensure consistency and avoid potential issues with React's reconciliation process.
}) => { | ||
const [isLoading, setIsLoading] = useState(false); | ||
const [userData, setUserData] = useState<User | null>(null); | ||
const [hasErrorMessage, setErrorMessage] = useState(''); |
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 state variable hasErrorMessage
is misleadingly named. Since it holds a string message rather than a boolean, consider renaming it to errorMessage
to better reflect its purpose.
No description provided.