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
AI Native なプロダクト組織の立ち上げ方 : 生産性 100 倍への挑戦
mikesorae
0
1.8k
Dataflow周りで地雷を踏みまくった話
mikesorae
0
19
Functional Programming in Frontend Elm編
mikesorae
1
140
Other Decks in Technology
See All in Technology
QAと開発の両側から進める AI活用 -QAプロセスAI支援ツールキットと Inner Loop / Outer Loopの取り組み-
legalontechnologies
PRO
2
360
Escolhendo LLMs na Prática: Lições Reais em Busca Agêntica no Mercado Livre —TDC 2026 Floripa
jpbonson
0
100
13年運用タイトルのサーバーサイドが辿り着いた現在地 ― モンスターストライクにおける技術・組織・AI活用から得た知見
mixi_engineers
PRO
1
320
なぜ、あなたのAPIは使われないのか? AX時代の設計原則、ガードレール、運用体制
yokawasa
1
260
LLMリーダーボードアップデートに向けたAgentic Math_SWEのトレースについて
nejumi
0
100
AIで楽になるはずが、なぜ疲れる?
kinopeee
0
140
AI時代におけるテストの基礎の再定義 / Rethinking the Fundamentals of Testing in the AI Era
mineo_matsuya
15
6.2k
信頼できるテスティングAIをどう育てるか?
odan611
0
160
【5分でわかる】セーフィー エンジニア向け会社紹介
safie_recruit
0
53k
システム監視入門
grimoh
5
750
Power Automateアップデート情報
miyakemito
0
280
それでも、技術なブログを書く理由 #kichijojipm / Why I Still Write Tech Blogs Even Now
shinkufencer
0
1.2k
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
420
My Coaching Mixtape
mlcsv
0
180
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
420
AI: The stuff that nobody shows you
jnunemaker
PRO
9
850
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
160
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Code Review Best Practice
trishagee
74
20k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Discover your Explorer Soul
emna__ayadi
2
1.2k
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جຊతʹσʔλͱঢ়ଶͷදݱͰ͔͠ͳ͍ • ΠϯλʔϑΣʔεϑΝʔετͰߟ͑Α͏ • ෦࣮ΛӅṭ͠Α͏ • ԼҐίϯϙʔωϯτͰ͖Δ͚ͩදࣔʹઐ೦ ͠Α͏