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
Reactで学ぶUIコンポーネントデザイン / UI Component Design wit...
Search
mikesorae
July 12, 2017
Technology
3.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Reactで学ぶUIコンポーネントデザイン / UI Component Design with React
mikesorae
July 12, 2017
More Decks by mikesorae
See All by mikesorae
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
5.4k
Dataflow周りで地雷を踏みまくった話
mikesorae
0
26
Functional Programming in Frontend Elm編
mikesorae
1
150
Other Decks in Technology
See All in Technology
増え続けるプロダクトの品質をどう担保するか。ProductSpecとTypeScriptによる取り組み
joere
3
390
攻撃 3 時間 vs 復旧 10 時間。アクセスキー流出の非対称性を体感するために CTF を作った話
kazzpapa3
1
140
企画からFlutter実装まで、1つの機能を一貫して開発したプロセスと成果物
khiroyuki1003
1
150
bpf_arenaとstruct_opsを使うのが難しかった話
masu_mi
1
140
Deep Data Security 機能解説
oracle4engineer
PRO
3
1k
2拠点SRE活動始めてみた | sogaoh's LT @ ホンマでっかSRE勉強会 #3
sogaoh
PRO
0
240
20261031_IoTLT_vol140_kitazaki_v1.pdf
kitazaki
0
170
ライフワーク「猫でもわかるDirectConnect」
kentapapa
0
150
FinOpsを導入してマルチプロダクトのコスト最適化を実現する
kworkdev
PRO
0
130
AI時代の組織作り:チーム開発から「個人×AI」への移行と、持続可能な「開発資本」の築き方
ham0215
1
100
サボる子はいねぇがー!AgentCoreハーネスの脆弱性に学ぶ、エージェントの入力バリデーション
iwamot
PRO
4
230
AI AgentによるEmbedded SREの取り組み
tgidgd
1
340
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
234
19k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
350
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
470
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
390
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.7k
Skip the Path - Find Your Career Trail
mkilby
1
280
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
330
How STYLIGHT went responsive
nonsquared
100
6.4k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
240
Optimising Largest Contentful Paint
csswizardry
37
4k
Scaling GitHub
holman
464
140k
Transcript
ReactͰֶͿ UIίϯϙʔωϯτ σβΠϯ
ࣗݾհ • iOS/AndroidΞϓϦ։ൃ • 6ؒͰ30ຊͷεϚϗΞϓϦΛઃܭ/ • ͳͷͰUIͷநԽ͕͖ • ϑϩϯτΤϯυ •
੩తαΠτ͔ΒSPA·Ͱ • γεςϜΞʔΩςΫτݟश͍
Α͔ͬͨ͜ͱ • νʔϜϝϯόʔ͕ComponentࢦͰ࡞ΕΔΑ ͏ʹͳͬͨ • ઃܭൣғ͕໌֬ʹͳͬͨ • SMACSSBEMΛ͋·Γߟ͑ͳͯ͘Α͘ͳͬ ͨ
ͭ·͖ͮͲ͜Ζ • நԽͷ୯Ґ • ঢ়ଶΛ࣋ͭॴ • ෳࡶ͗͢ΔΠϯλʔϑΣʔε
React Basic Theoretical Concepts (ൈਮ)
Transformation • UIσʔλ͔Βผͷσʔλܗࣜͷ୯ͳΔ ӨͰ͋Δɻ Original Data Presentational Data
Abstraction • UI࠶ར༻ՄೳͳཁૉʹநԽՄೳͰɺ͜Ε Β࣮ͷৄࡉΛ֎෦ʹ࿙ग़͠ͳ͍ɻ Component CSS Scroll Moment Timer Velocity
Composition • ෳͷUIͷநΛ߹ͯ͠ผͷநΛ࡞͢ Δɻ Card Search Bar Filterable CardList Card
State • UI୯ͳΔαʔόɾϏδωεϩδοΫͷঢ়ଶ ͷίϐʔͰͳ͍ɻ(ͷͰ࣌ʹUIͷঢ়ଶΛ࣋ ͭ͜ͱ͕ඞཁ) Original Data Presentational Data State
UserEvent
Presentational / Container Component
Presentational & Container Container Presentational Presentational Presentational Presentational Container Presentational
Presentational Component • Presentational Componentͷؔ৺͝ͱݟͨ ͷΈɻ • ΠϕϯτॲཧσʔλͷՃContainerʹ ͤΔ
Container Component • ϏδωεϩδοΫPresentational Componentؒͷ૬ޓ࡞༻Λཧ͢Δɻ • ಛʹFlux ArchitectureͰstoreΛComponent ʹඥ͚ΔׂΛ࣋ͭɻ
UIͷநԽ
UIίϯϙʔωϯτͷղ
ϩάΠϯϑΥʔϜͷ߹ • ID/Passwordೖྗ͕Ͱ͖Δ • ID/ύεϫʔυ͕8จࣈҎͷ߹Τ ϥʔΛදࣔ͢Δ • ೖྗΤϥʔ͕͋Δͱ͖ϩάΠϯϘλ ϯΛΫϦοΫͰ͖ͳ͍ •
ϩάΠϯϘλϯΛΫϦοΫ͢Δͱid/ passwordΛฦ͢ id hogehoge password ******* id must be at least 8 characters Login
σʔλߏΛߟ͑Δ id hogehoge password ********* Login ϩάΠϯϑΥʔϜ - ϢʔβID -
ύεϫʔυ
ৼΔ͍Λݟ͚ͭΔ id hogehoge password ********* Login ϩάΠϯϑΥʔϜ - ϢʔβID -
ύεϫʔυ - IDΛνΣοΫ͢Δ - ύεϫʔυΛνΣοΫ͢Δ - ϩάΠϯϘλϯΛ༗ޮʹ͢Δ - ϩάΠϯϘλϯΛແޮʹ͢Δ
ঢ়ଶΛݟ͚ͭΔ 送信不可 送信可能 検証OK 検証NG ૹ৴Մ൱ঢ়ଶ ೖྗݕূঢ়ଶ
࣮ʹམͱ͠ࠐΉ LoginForm - userId: string - password: string - onSubmit:
function - validateUserId(userId): bool - validatePassword(userId): bool - canSubmit: bool - handleSubmit(userId, password) <LoginForm userId={this.props.userId} password={this.props.password} onSubmit={this.handleSubmit} />
͏গ͠൚༻తʹ͢Δ • όϦσʔλʔΛ֎͔Βઃఆ͍ͨ͠ • ೖྗϑΟʔϧυΛ࠶ར༻Ͱ͖ΔΑ͏ʹ͍ͨ͠
ݟͨʹूத͢Δ Container LoginForm Input Input SubmitButton Validator Validator
ίϯϙʔωϯτΛׂ͢Δ LoginForm - userId: string - password: string - userIdValidator:
function - passwordValidator: function - onSubmit: function - handleSubmit(userId, password) Input - value: string - type: string - onChange: function - handleChange(value) SubmitButton - value: string - disable: bool - onClick: function - handleClick() ೖྗͱݕূؔʹΑͬͯ Ұҙʹݟ͕ܾͨ·ΔUIίϯϙʔωϯτ͕Ͱ͖Δ
·ͱΊ • UIجຊతʹσʔλͱঢ়ଶͷදݱͰ͔͠ͳ͍ • ΠϯλʔϑΣʔεϑΝʔετͰߟ͑Α͏ • ෦࣮ΛӅṭ͠Α͏ • ԼҐίϯϙʔωϯτͰ͖Δ͚ͩදࣔʹઐ೦ ͠Α͏