Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
form validation in react
Search
yiminghe
March 19, 2015
Technology
4
570
form validation in react
do form validation using react
yiminghe
March 19, 2015
Tweet
Share
More Decks by yiminghe
See All by yiminghe
小程序终端技术架构
yiminghe
0
260
支付宝小程序的开放架构
yiminghe
0
200
gitc2016 react based architecture
yiminghe
1
180
antd at qcon2016
yiminghe
1
240
react-based architecture
yiminghe
2
170
React Ecosystem At Ant Financial
yiminghe
4
2.3k
ant design preview
yiminghe
1
320
react best practice
yiminghe
3
230
react at alipay
yiminghe
43
4.5k
Other Decks in Technology
See All in Technology
LINEヤフーにおけるAI駆動開発組織のプロデュース施策
lycorptech_jp
PRO
0
190
なぜAIは組織を速くしないのか 令和の腑分け
sugino
80
50k
Databricks (と気合い)で頑張るAI Agent 運用
kameitomohiro
0
340
Microsoft Fabric のワークスペースと容量の設計原則
ryomaru0825
2
210
2026-02-24 月末 Tech Lunch Online #10 Cloud Runのデプロイの課題から考えるアプリとインフラの境界線
masasuzu
0
100
LINE Messengerの次世代ストレージ選定
lycorptech_jp
PRO
3
1.6k
opsmethod第1回_アラート調査の自動化にむけて
yamatook
0
330
AIに視覚を与えモバイルアプリケーション開発をより円滑に行う
lycorptech_jp
PRO
1
570
社内でAWS BuilderCards体験会を立ち上げ、得られた気づき / 20260225 Masaki Okuda
shift_evolve
PRO
1
150
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
360
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
15
95k
Master Dataグループ紹介資料
sansan33
PRO
1
4.4k
Featured
See All Featured
Producing Creativity
orderedlist
PRO
348
40k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
760
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Test your architecture with Archunit
thirion
1
2.2k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
140
30 Presentation Tips
portentint
PRO
1
250
The Mindset for Success: Future Career Progression
greggifford
PRO
0
260
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
940
We Are The Robots
honzajavorek
0
190
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
380
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
750
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