How to refresh your react server components when data changes #shorts

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Clutch as always. This was killing my side project this week

strapnastii
Автор

Grateful for this solution! It worked seamlessly, saving me time and frustration. Thank you for sharing this helpful guide!

imrank
Автор

This video made server components click in my head!!!! Thank you

jareddiscipio
Автор

Couldn't figure that myself so I did it with state and dependency array. Thank you, that is very useful!

Nofy
Автор

problem is when the query took so long, it will display a blank white page. Just like the old days.

webbi
Автор

You could export a const revalidate with true it will revalidate. Or in your fetch call you can invalidate cache, or if you have a server action you can call revalidatePath in that action. I have done it today using server action

devsami
Автор

Which extension are you using to get those multi coloured columns ?

ketansharma
Автор

THANK YOUUUU... Bing AI and Codeium couldn't figure this out...

adtc
Автор

how to revalidate server components individually?

lets say I have a page which is static, and I want to have a server component within it to only be "dynamic server component", like to revalidate when data changes. not the whole page route, only that component,

RationalDissonances
Автор

Thank you very mutch, you saved my life <3

GuirdyYT
Автор

I've hit that issue. router.refresh is nice when the data is displayed on the current page. But let say my edit/create page is a separate one from the show page. Short of a useEffect(() => router.refresh(), []) in the show page (which would suck), I'm a bit stumped.

fward
Автор

Is there any way to do an optimistic update here? Assuming you know what the added user will be. Or is that not possible with a server component?

mathiasstrohkirch
Автор

@WebDevCody RevlidatePath or RevalidateTag doesn't work, I've build BMS and it's not refreshing the data in table, I've similar structure as you do in this video.
- Server Component
- Form (Client Component)
- Table

ziacodes
Автор

It's no more efficient and uncomplexity way use an useEffect with an array dependency to reload the component?

dotnetwithmark
Автор

Great video!
Isn't it recommended to use actions?

amin
Автор

Why not use effect with users dependncy?

yogeshvanzara
Автор

You could also do revalidatePath right?

DrSarge
Автор

What is better, this or use a state ?, I mean useWffect with some useState

AC-sjhu
Автор

sir, how you hop from one language to other i seen you working on react - react typescript - react native - gatsby - some times even javascript - and now its next js

i want to know, whats better !? levelup or become professional on particular language

and one important question whats best to learn react or nextjs (in real life projects)
if nextjs.. what is the need of adding expressjs and some times gatsby as a combination to nextjs to projects helps us ?

expecting a complete info

boundless_nomad
Автор

How can i refresh ONLY one component on my page ?

z_