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
Reactとフォームとスキーマバリデーション / React forms with Schem...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
kamijin_fanta
January 12, 2021
Technology
0
2.7k
Reactとフォームとスキーマバリデーション / React forms with Schema Validation
kamijin_fanta
January 12, 2021
Tweet
Share
More Decks by kamijin_fanta
See All by kamijin_fanta
2025-09-22 Iceberg, Trinoでのログ基盤構築と パフォーマンス最適化
kamijin_fanta
1
740
2025-04-14 Data & Analytics 井戸端会議 Multi tenant log platform with Iceberg
kamijin_fanta
1
570
IoT向けストレージにTiKVを採用したときの話 / 2024-10-25 TiUG Meetup 3 Using TiKV as IoT storage
kamijin_fanta
0
140
TrinoとIcebergで ログ基盤の構築 / 2023-10-05 Trino Presto Meetup
kamijin_fanta
1
2.2k
Unicodeと符号化形式
kamijin_fanta
0
1.1k
2020/05/25 さくらのクラウド向けツールを使いこなす
kamijin_fanta
3
350
2019-01-24 業務でのOSSとの関わり方
kamijin_fanta
7
5k
関数型言語で始めるネットワークプログラミング
kamijin_fanta
0
1.1k
2018-11-10 Akka-HTTPで作るAPIサーバ
kamijin_fanta
2
4k
Other Decks in Technology
See All in Technology
メルカリのAI活用を支えるAIセキュリティ
s3h
8
5.8k
コスト削減から「セキュリティと利便性」を担うプラットフォームへ
sansantech
PRO
1
600
Amazon ElastiCacheのコスト最適化を考える/Elasticache Cost Optimization
quiver
0
350
Amazon Bedrock AgentCore 認証・認可入門
hironobuiga
2
470
オープンウェイトのLLMリランカーを契約書で評価する / searchtechjp
sansan_randd
3
530
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1k
レガシー共有バッチ基盤への挑戦 - SREドリブンなリアーキテクチャリングの取り組み
tatsukoni
0
130
セキュリティについて学ぶ会 / 2026 01 25 Takamatsu WordPress Meetup
rocketmartue
1
210
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
120
小さく始めるBCP ― 多プロダクト環境で始める最初の一歩
kekke_n
0
220
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
2.9k
ゼロから始めたFindy初のモバイルアプリ開発
grandbig
2
590
Featured
See All Featured
Skip the Path - Find Your Career Trail
mkilby
0
51
Visualization
eitanlees
150
17k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
230
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
54
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
400
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.2k
30 Presentation Tips
portentint
PRO
1
200
AI: The stuff that nobody shows you
jnunemaker
PRO
2
230
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
740
The Curse of the Amulet
leimatthew05
1
8k
Transcript
React forms with Schema Validation 2021/01/12 kamijin-fanta
TypeScriptやってますか データ構造のValidationやってますか
Data Structure Validation フィールド型・データの範囲などを定義・検証する仕組み ⼈間が検証コードを書く必要が無くなって良い spec JSON Schema Swagger impl:
go, python等様々な⾔語にてライブラリが存在 { "type": "string", "minLength": 2, "maxLength": 3 }
superstruct TypeScriptで利⽤できるデータ検証ライブラリ https://docs.superstructjs.org/ サンプルコード: https://github.com/kamijin-fanta/react-form-schemavalidation- example/blob/master/src/superstruct/basic.test.ts
superstructの使いみち APIで投げられたPOST Bodyの検証 ユーザの⼊⼒フォームの検証 ← 便利そう
react-hook-form パフォーマンスが良いReactのフォームライブラリ バリデーション・繰り返しフィールド等の機能が⼀通り揃っていて良い サンプルコード: https://github.com/kamijin-fanta/react-form-schemavalidation- example/blob/master/src/simple-form/simple-form.tsx
react-hook-formの⾯倒な所 エラー⽂章を⾃分で書く必要が有る バリデーション内容から勝⼿に⽂章作って欲しい errors onSubmit が型安全でない
react-hook-form+superstruct react-hook-form で書いていたルールを全てsuperstructで定義する superstructがエラー⽂の⽣成する superstructが型を定義する react-hook-formの⾟さを軽減出来る https://github.com/kamijin-fanta/react-form-schemavalidation- example/blob/master/src/schema-validation-form/schema-validation-form.tsx
react-hook-form+superstruct構成はreactでフォーム作る⼈にオススメ