Using Forms in Next.js (Server Actions, Revalidating Data)

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

0:00 – Introduction
0:06 – Demo
0:21 – Forms with Pages Router
1:05 – create-next-app
1:30 – Server Component (Data Fetching)
1:58 – Forms and action prop
3:05 – Server Actions (and useFormState)
4:32 – Progressive enhancement
5:03 – Loading states (useFormStatus)
7:13 – Revalidating data and caching
8:12 – Accessibility and error states
9:58 – Conclusion

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

Genuinely excited about this 🙌 I'd love to see more complicated examples with Zod validation

austincodes
Автор

new, important and complicated concept such as `server action` the author explains on even more complicated usecases.

maksymdudyk
Автор

I learn by doing. Not by reading. This was exactly what i needed. I implemented this, saw it working, learnt how and why it worked and added it to my project. Perfecto. Thanks bro.

marktaylor
Автор

This is great! Can you do a follow up with some more advanced stuff? Like, how do I handle optimistic updates & failures/rollbacks, how do I ensure my TODOs mutation state is synced across all pages/components that might need it, how can I update TODOs state from within the app code (not as part of a form submission). In other words -- is it possible to use this new paradigm to replace most of what Redux does?

EvHaus
Автор

I genuinely love Next. It has changed my life financially and has made working with the web intuitive.

robgioeli
Автор

Hi Lee and engineers 👋

Thank you for the smooth video. Watching this I came to a few questions:

1. What is the reason to move from the previous approach? How much performance are we winning here? It would be nice to see some good and old before/after comparisons.
2. Many people are asking for more advanced cases, but are those even possible? I don't see modern forms without the usual rerendering that we used until now.

Thank you and I hope for more such videos in the future!

improvingwithfun
Автор

Whoever drew up Lee's specs was very kind. Smart, endearingly charming, adorable as all hell

kyle-andrewgovinder
Автор

Really nice video, your explanations are always amazingly informative, thanks a lot 🔥Also, can’t wait for the stable release of the “cache” function, good to know that it’s coming soon

pawelblaszczyk__
Автор

this thing definitely gonna hurt my head for a few days. thanks for the video.

JamesNMK
Автор

Thanks for this tutorial, Lee. Excellent job clarifying in simple terms the elements of server actions.

MikeBritton
Автор

This was a great explaination... the docs were pretty hard to follow and understand. None of the examples connect together so its hard to get a full picture of what is going on.

patrickjreid
Автор

Thanks a lot for your explanations and demo it was really useful for me. The only question I didnt find answer on is how to handle multiple actions within single form

vbvsyzw
Автор

3:21 - wait a minute. Maybe I'm not understanding something, but doesn't schema.parse throw an error if the data is incorrect? And if yes, shouldn't it be inside the try block?

Krzysiekoy
Автор

Thank you for the video. Very imformative. Shows how easy it is to create form in Next.js!

AlfonsusAC
Автор

Great walk through as usual! Thank you. 🙏

guylepage
Автор

Please make long format video diving into topics like:
client side validation, dependant fields, client side data formatting, array fields...

filipkovac
Автор

thanks lee, this is awesome. I'm just wondering how to clear the text input after a new todo has been created. So much cool stuff to try out!!!

gmzi
Автор

Great job guys, I'd love if server get stable and I will heavly use it !!

rockNbrain
Автор

always appreciating your valuable content

mohamed-zhioua
Автор

Super great and educational videos you do! Keep it up!

Sorkstryparen