Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

done #2712

wants to merge 1 commit into from

Conversation

AlexLiashenko19
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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('');

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}>

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('');

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants