Skip to content

Develop #1491

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Develop #1491

wants to merge 4 commits into from

Conversation

vikshiyan
Copy link

Copy link

@Svidruk Svidruk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice !

Copy link

@igorkruz igorkruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job 👍
let's improve your solution

Review the attached video and fix the bug.
https://www.loom.com/share/ddbab52f666943d7a3fc6aa58c05105f

src/App.tsx Outdated
Comment on lines 83 to 86
todoFromService
.getTodos()
.then(setTodos)
.catch(() => setErrorMessage(TypeError.LOADING));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to move the logic inside the useEffect hook to a separate function, as it improves code readability, reusability, and makes testing easier. It also helps keep useEffect focused on side effects.

setErrorMessage: React.Dispatch<React.SetStateAction<TypeError>>;
};

export const Error: React.FC<Props> = ({ errorMessage, setErrorMessage }) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export const Error: React.FC<Props> = ({ errorMessage, setErrorMessage }) => {
export const Error: FC<Props> = ({ errorMessage, setErrorMessage }) => {

fix
@vikshiyan vikshiyan requested a review from igorkruz November 25, 2024 14:33
Copy link

@igorkruz igorkruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done 🔥
Approved, but left suggestions for the future.

type="button"
className="todoapp__clear-completed"
data-cy="ClearCompletedButton"
disabled={completedTodos.length === 0}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
disabled={completedTodos.length === 0}
disabled={!completedTodos.length}

Comment on lines +72 to +75
todoFromService
.getTodos()
.then(setTodos)
.catch(() => setErrorMessage(TypeError.LOADING));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to move the logic inside the useEffect hook to a separate function, as it improves code readability, reusability, and makes testing easier. It also helps keep useEffect focused on side effects.

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.

None yet

3 participants