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
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
レガシーコードに対する loop engineering的なAI開発プロセス導入について
kubell_hr
0
290
Kiro IDE 入門 (画面の各部から、頼み方、任せ方、戻し方まで) | 目指せ Kiro マスター 02
inariku
PRO
4
170
TSKaigi Sendai 2026 - tsgo時代のTypeScript Playgroundはどう動くか
teamlab
PRO
0
110
DBTS2026 盛り上がってますか!?Databricksが実現するAI時代のデータ基盤
akuwano
1
200
JAWSコミュニティに 参加して1年経った結果
ssakita
0
120
AIコーディングはじめました
miso
0
160
Cloudflareの向き先
chimame
1
150
視野はAIに、視座は人に / ai-for-breadth-humans-for-perspective
nkzn
6
3.2k
セキュリティ専任チームなしで攻撃を先回りするSREが実践したSIEM on Amazon OpenSearch Service
cscengineer
PRO
1
720
超⼩型・多⾔語検索モデル Bekko Embedding
hotchpotch
1
140
Context Ontology Accelerator 入門 (業務データの意味を、AI エージェントに渡す)
inariku
PRO
3
590
業務でAWSをあまり使っていない私が、AWSへのモチベを保つ方法
smt7174
0
180
Featured
See All Featured
Side Projects
sachag
456
43k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
770
The agentic SEO stack - context over prompts
schlessera
0
1k
Designing for Timeless Needs
cassininazir
1
550
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
670
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
470
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.2k
It's Worth the Effort
3n
188
29k
GraphQLとの向き合い方2022年版
quramy
50
15k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
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