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

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

На главную

Adding form validation to your React app? Try the "reward early, punish late" pattern 🏆

36,764 просмотров • 2 лет назад •via X (Twitter)

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

Фото профиля Ben Holmes
Ben Holmes2 лет назад

You can codegen this for any app using simple-form!

Фото профиля Ben Holmes
Ben Holmes2 лет назад

Got a full code walkthrough using Astro and Next.js!

Фото профиля Jamon
Jamon2 лет назад

I love these types of subtle UX improvement tips.

Фото профиля Deadlock
Deadlock2 лет назад

These features already available in react-final-form. it's an underdog for form state management as well as light weight package

Фото профиля KEV MOK
KEV MOK2 лет назад

Really top quality video. Have you thought of using Zod with your form validations?

Фото профиля Ben Holmes
Ben Holmes2 лет назад

@LinkedKev Not just *thought* about it. I made a wrapper library 😄

Фото профиля Brian Jordan
Brian Jordan2 лет назад

This has brought me psychic peace, always felt like early early was wrong but not sure why

Фото профиля Tracy Lee | ladyleet
Tracy Lee | ladyleet2 лет назад

Great video, Ben!!!

Фото профиля John Forte
John Forte2 лет назад

Yep, this is why most form packages have isTouched (onBlur) or isDirty (after user modifies field) to allow you to implement things like this.

Фото профиля Magne
Magne2 лет назад

what about checking on input but only after user stops typing? solves both cases I think

Фото профиля Ben Holmes
Ben Holmes2 лет назад

Sounds like validating on a debounce. That's nice sometimes as well! Still, it assumes the user is able to type at a certain speed, and it's hard to dial in an accessible value. Waiting for blur makes certain you validate once the user is done

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