Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
form validation in react
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
yiminghe
March 19, 2015
Technology
590
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
form validation in react
do form validation using react
yiminghe
March 19, 2015
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
350
支付宝小程序的开放架构
yiminghe
0
280
gitc2016 react based architecture
yiminghe
1
200
antd at qcon2016
yiminghe
1
260
react-based architecture
yiminghe
2
200
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
360
react best practice
yiminghe
3
250
react at alipay
yiminghe
43
4.6k
Other Decks in Technology
See All in Technology
Shared Signals Framework 仕様解説
oidfj
0
340
Agent Harnessはどう作る?事例から学ぶAI Agentの設計思想
sergicalsix
0
230
アラートを見直していたら営業組織への理解にちょっとだけ繋がった話
z63d
0
140
詳解 never 型 - ボトム型の性質を深掘り
nealle
0
160
AWSを利用する上で知っておきたい名前解決の話 2026
nagisa53
5
3.3k
なぜ東京にいる私が、新潟の技術コミュニティを運営するのか by 八雲慎之助
yakumo
0
230
AWS Quick 入門 | 目指せ Quick マスター 01
inariku
PRO
2
270
レガシーコードに対する loop engineering的なAI開発プロセス導入について
kubell_hr
0
310
DBTS2026 盛り上がってますか!?Databricksが実現するAI時代のデータ基盤
akuwano
1
200
[General] 개발자로 해외 기업에서 일하기
skydoves
1
310
GCASアップデート(202607-202610)
techniczna
1
240
Cloudflareの向き先
chimame
1
160
Featured
See All Featured
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
970
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
380
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
470
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The SEO identity crisis: Don't let AI make you average
varn
0
630
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
680
Writing Fast Ruby
sferik
630
63k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
560
Transcript
Form Valida+on In React
[email protected]
form • Tradi+onal way • Library way
• React way – rc-‐form-‐valida+on
Tradi+onal way
Problems • Maintenance – Script and html is separated
– A lot of duplica+on – Hard to reuse code – …
Library way • hFp://jqueryvalida+on.org/documenta+on/
Library way • But you s+ll need to get data
when submit! • hFps://api.jquery.com/serialize/
Problems Customiza/on! Invasion!
In Short
DOM Driven
React Way DATA
Driven
Introduce • rc-‐form-‐valida+on • hFps://github.com/react-‐component/form-‐ valida+on
in general
Step by step -‐1 • Valida+on.FieldMixin – handleValidate – setField
Step by step -‐2 • Declare data model – formData:
field value geFer and seFer – Status: field status (errors,valida+ng…)
Step by step -‐3 • Just render html by data
model and valida+on rules – handleValidate provided by mixins – Declare rules in Validator – Wrap input by Validator and Valida+on
Step by step -‐4 • Validate on submit and get
data – Call validate method – Just get data from data model (two-‐way binding)
Advanced usage • Asynchronous valida+on • Validate custom
component
Asynchronous valida+on • Use validator func+on
Validate custom component • Validate custom component which supports
onChange props, such as rc-‐calendar:
What’s next • Isomorphic Valida+on – hFps://github.com/yiminghe/async-‐validator • rc-‐form-‐valida/on
depends on async-‐validator • async-‐validator can be run at nodejs! Let’s share some valida/on rules!
Try hFp://react-‐component.github.io/form-‐ valida+on/build/examples/form.html