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で学ぶUIコンポーネントデザイン / UI Component Design wit...
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Functional Programming in Frontend Elm編
mikesorae
1
130
Other Decks in Technology
See All in Technology
Mastraエージェント、どのクラウドにデプロイする?
minorun365
PRO
2
140
アラート調査向けAIエージェントの本番導入とその後/AI Agents for Alert Investigation: Production Deployment and After
taddy_919
1
330
Agentic AI 時代のテスト手法: Kiro とはじめるプロパティベーステスト (AWS Summit Japan 2026 | DEV212)
ymhiroki
0
200
ゼロをイチにする仕事が終わったあと
smasato
0
270
「ビジネスがわかるエンジニア」とは何か?
ryooob
0
490
デジタル・デザイン:次の50年を描く「進化する青写真」
y150saya
0
800
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
11k
しぶいSRE: サーバから見えない障害にどう向き合うか。ラストワンマイルのデバッグ実践 / Shibui SRE
kanny
0
210
AWS Summit 2026で見えたSIerにとっての Amazon Quickの位置づけ
maf_0521
0
160
RAGの精度向上とエージェント活用
kintotechdev
2
120
最近評価が難しくなった
maroon8021
0
200
背中から、背中へ /paying forward to community
naitosatoshi
0
210
Featured
See All Featured
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
230
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
200
Art, The Web, and Tiny UX
lynnandtonic
304
22k
WENDY [Excerpt]
tessaabrams
11
38k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
150
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
630
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
210
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
How GitHub (no longer) Works
holman
316
150k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
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جຊతʹσʔλͱঢ়ଶͷදݱͰ͔͠ͳ͍ • ΠϯλʔϑΣʔεϑΝʔετͰߟ͑Α͏ • ෦࣮ΛӅṭ͠Α͏ • ԼҐίϯϙʔωϯτͰ͖Δ͚ͩදࣔʹઐ೦ ͠Α͏