Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

Demo of forms with React 19 and Next.js. If you've wondered... "Why does the form clear out my input values?" "How do I pass data from my server action → client?" "How do I handle client / server validation?" "How do I display inline errors next to inputs?" This...

42,736 görüntüleme • 1 yıl önce •via X (Twitter)

11 Yorum

Lee Robinson profil fotoğrafı
Lee Robinson1 yıl önce

Thanks for the suggestion @JamieBytebender! Hope this helps.

Lee Robinson profil fotoğrafı
Lee Robinson1 yıl önce

There's a bunch of other things I could cover, but this is a start – I just turned on the camera and yapped for a few minutes 🤣

UserInterface profil fotoğrafı
UserInterface2 yıl önce

How to Make Sales on UserInterface Freelance Marketplace #freelance

Lucas James Quinn profil fotoğrafı
Lucas James Quinn1 yıl önce

One selling point is that such form can work with JavaScript disabled. The question is, is it worth the effort to make things work this way? I admit that some validation should be done server-side, but much of it can be handled client-side. Maybe we should choose the best fit.

object Object profil fotoğrafı
object Object1 yıl önce

many are complaining, but I really like this pattern opposed to having to rewrite useState and useEffect and handleSubmit code all the time

Musawir Raji 🪖 profil fotoğrafı
Musawir Raji 🪖1 yıl önce

Thank you for this

Brayan profil fotoğrafı
Brayan1 yıl önce

Love these ❤️

Jason profil fotoğrafı
Jason1 yıl önce

Spent the last few months figuring out all of this and loving the results now. One thing I haven't figured out is how to handle a redirect after submission from the server action. Like your example, I'm using a try/catch and handling a few actions depending on how our CMS authors have configured their form behavior. Redirects in the try block would be ideal, but they error out. Instead I need pass the redirectUrl back to the form component and handle with an effect. Is that the best I can do?

Lee Robinson profil fotoğrafı
Lee Robinson1 yıl önce

Why does it need to be in a try block? If it’s truly an uncaught exception, it would bubble to your error boundary.

JWWW profil fotoğrafı
JWWW1 yıl önce

forms + rsc are the biggest reason I started moving projects over from pages to app router. a much better mental model

Yordis Prieto profil fotoğrafı
Yordis Prieto1 yıl önce

I am glad it was kept simple (not easy). Now, we can wrap things up and ease them without shooting ourselves in the foot at such a low level!

Benzer Videolar