Загрузка видео...

Не удалось загрузить видео

На главную

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 просмотров • 1 год назад •via X (Twitter)

Комментарии: 11

Фото профиля Lee Robinson
Lee Robinson1 год назад

Thanks for the suggestion @JamieBytebender! Hope this helps.

Фото профиля Lee Robinson
Lee Robinson1 год назад

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
UserInterface2 лет назад

How to Make Sales on UserInterface Freelance Marketplace #freelance

Фото профиля Lucas James Quinn
Lucas James Quinn1 год назад

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
object Object1 год назад

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 🪖
Musawir Raji 🪖1 год назад

Thank you for this

Фото профиля Brayan
Brayan1 год назад

Love these ❤️

Фото профиля Jason
Jason1 год назад

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
Lee Robinson1 год назад

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
JWWW1 год назад

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

Фото профиля Yordis Prieto
Yordis Prieto1 год назад

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!

Похожие видео