Advanced React Query Pattern

preview_player
Показать описание
Advanced React Query Pattern #react #reactjs #reactjsdeveloper #programming #progammer #frontend #devtok #coding #code #codetok #cs
Рекомендации по теме
Комментарии
Автор

The useQuery hook returns isLoading, which should be enough to handle the same thing.

dukdukgeeshit
Автор

This is only makes sense if you’re going to render a fallback that is different than what is normally rendered, otherwise this is pointless

richardantao
Автор

return isLoading, before return the true element is the best approach

indofiz
Автор

No not always the case. When you have a table when you do this, when the filter changes it fetch again with new filter. So you will have loading display everytime that will be so annoying for users instead of just having loading animation inside the table.

chess
Автор

Can be useful but dont wrap your app component.

cenkakay
Автор

can you make a video to explain
how react renders component
for example when state changes who gets rerendered and who is not
how useEffect rerenders the component also
for example you take the component and tell what happens after each line like you did in your other videos so explain the rerender
and some other performances tips using memo usecallbacks

mohamedsalimbensalem
Автор

Will that renderd the "Loadin..." div each time something is fetching?

hooooman.
Автор

Its a good hook, but There is an important thing!!! Now if you have any kind of error. It will brake your app. (If you dont have ErrorBoundry.)

hassanad
Автор

React shorts are rough. I don’t know how you’d explain anything with enough detail for someone to understand what is going on.

For example, a suspense query requires so many more concepts to be understood than useQuery, which already requires sooo much knowledge.

It’s also important to note that you also need an error boundary, not just suspense, this app will crash if the promise throws 😢

lleytonmorris
Автор

How about just adding a loading check?

noobweaver
Автор

What’s the difference between this and having a
if(!user) return <div></div>

Coughi
Автор

So if the fetch fails, will the component not render, showing only a blank screen?

Anto-mipn
Автор

Do you guys use it in server components or just client? I dont see the need in client components nextjs

jitxhere
Автор

Do we need async if we use useSuspenseQuery?

andersonkoh
Автор

is this really advanced? what's a simple pattern then? i one time read the docs. didn'tknow i knew how to do that

thecajunchopin
Автор

Why do i need to block rendering of the entire app just because "user" is fetching...i think I'm fine with using is pending to handle

crim-son
Автор

You have initator property to initialize the return of your useQuery. Use suspenseQuery for this use case make no sence.

lucasgiunta
Автор

NoW ThE pRoBleM WiTh ThIs

is that you're using react

AregGhazaryan