Lazy loading for performance in React

preview_player
Показать описание
How lazy loading in React works #react #reactjs #reactjsdeveloper #programming #progammer #frontend #coding #code
Рекомендации по теме
Комментарии
Автор

In addition to suspense, it might also be wise to wrap this in an error boundary in case the request fails (who knows the user might have a really spotty connection)

BrandonTomonGoogle
Автор

Thank you so much for the great content, new subscriber 😊

haithembensalem-qx
Автор

You should name the variable differently since it makes wrong sense now. Something like 'isLazyComponentOn'

Wimmful
Автор

I tried that it and the component used had a query to fetch data and it appeared that because the component was lazy loaded, that performance was worse to fetch and render data because it had to receive the component first and then run the query, so lazy load wisely.

AshtonMotana
Автор

Please please please make naore like this around react and thanks for this one...

aadityaa.
Автор

We must protect this code with a <Suspense> no ?

a.elghani
Автор

Should suspense be used in conjunction?

felipechaves
Автор

Thanks
What the best way to change the document title using react bro ? Iam still using useeffect but I dont Know if it’s the best way to

jhmesseroux
Автор

Hello What theme are you using in vsocde?

jashcodes
Автор

NextJS does it automatically??
Or we have to use next/import.
Is this in new update?

maheshgunjal
Автор

So we can say React.lazy() fun like dynamic import module?

jacquelynecarmen
Автор

so expensive as in 'a large amount of code' as opposed to expensive because of the calculation it's doing, right?

nickwoodward
Автор

I thought this behavior is by default in this senior?

haithembensalem-qx
Автор

What are we trying to optimize here? The computation or the bundle size?

Because if it’s just computation you could just simply wrap the component in a function and invoke the function in the ternary expression.

im.maxmou