This is how you can add loaders to server actions in next.js #shorts

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

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

This truly shows the current state of web-dev. The situation where for a very common use case the official documentation suggests you to use an experimental feature. "Totally safe in production! Trust me bro warranty guaranteed"

ivanbragin
Автор

Short and very informative. Thank you.

brayancuenca
Автор

Interesting 🤔 can't wait to get a stable server actions

xtz_
Автор

Can we show multiple things based on what’s happening like

Learning …
Fetching …
Compiling …

For example


Also u had suspense in your code why it didn’t work ? It should have been loading

ko-Daegu
Автор

it's getting complicated day by day... Yet another half baked react thing that creates its own loop and tools

greendsnow
Автор

Interesting hook.. does it let you grab other form statuses aside from pending? I'd probably jump into React Query for this use case, so trying to see what the benefit would be

ashundeyan
Автор

why not use useTransition hook for the pending state or useOptimistic for optimistic updates

abdelmounaimammari
Автор

But why do you use server action in server component?

ЕгорРубайло-зк
Автор

is it possible to use something similar for navigation? sometimes the page takes some time before exiting to the loading.tsx and I can't find a way to give a feedback to the user...

bloodylupin
Автор

Another hook.... I just use usestate and useeffect in all my projects, I don't care if it leads to more code

ChiragAggk