-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
add solution #947
Conversation
src/App.tsx
Outdated
}, [isLoaderActive, activeUser, userPosts]); | ||
|
||
const isPostListShow = useMemo(() => { | ||
return !isLoaderActive && userPosts.length > 0; |
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.
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, |
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.
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.
Consider deploying your page
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 👍
src/App.tsx
Outdated
.catch(() => {}) | ||
.finally(() => {}); |
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.
Why do you need these blocks?
If you didn't use them it's better to remove them.
src/components/UserSelector.tsx
Outdated
setActiveUser = () => {}, | ||
getUserPost = () => {}, |
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.
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.
https://dimarogkov.github.io/react_dynamic-list-of-posts/