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

add solution #947

Closed
wants to merge 3 commits into from
Closed

add solution #947

wants to merge 3 commits into from

Conversation

dimarogkov
Copy link

@dimarogkov dimarogkov commented Nov 1, 2023

src/App.tsx Outdated
}, [isLoaderActive, activeUser, userPosts]);

const isPostListShow = useMemo(() => {
return !isLoaderActive && userPosts.length > 0;
Copy link

Choose a reason for hiding this comment

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

Suggested change
return !isLoaderActive && userPosts.length > 0;
return !isLoaderActive && userPosts.length;

type RequestMethod = 'GET' | 'POST' | 'PATCH' | 'DELETE';

function request<T>(
url: string,
method: RequestMethod = 'GET',
data: any = null, // we can send any data to the server
data: any = null,
Copy link

Choose a reason for hiding this comment

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

image
Fix linter error

@dimarogkov dimarogkov requested a review from OleziO November 2, 2023 13:34
Copy link

@anastasiiavorobiova anastasiiavorobiova left a comment

Choose a reason for hiding this comment

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

Consider deploying your page

Copy link

@witflash witflash 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 👍

src/App.tsx Outdated
Comment on lines 34 to 35
.catch(() => {})
.finally(() => {});
Copy link

Choose a reason for hiding this comment

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

Why do you need these blocks?
If you didn't use them it's better to remove them.

Comment on lines 17 to 18
setActiveUser = () => {},
getUserPost = () => {},
Copy link

Choose a reason for hiding this comment

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

I think you don't need to default these functions in the props argument. As I see, these props are required in the Props interface. So they should exist anyway.

@dimarogkov dimarogkov closed this by deleting the head repository Jun 28, 2024
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.

4 participants