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_fukuoka
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Transnano
June 05, 2019
Technology
140
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
バックエンドエンジニアから見たReact #react_fukuoka
バックエンドエンジニアがReactに入門する際に敷居を下げるための発表資料
Transnano
June 05, 2019
More Decks by Transnano
See All by Transnano
ヤフーのデータ入出稿を支えるSRE
transnano
0
660
2019/07/11 ふくばねてす node-2 コンテナ移行におけるアレコレと使えるアレコレ(仮)
transnano
0
460
Consulって何だろう
transnano
0
130
PrometheusExporterを作ってみた+α
transnano
0
280
Other Decks in Technology
See All in Technology
Claude Code の Sandbox 機能を Anthropic Sandbox Runtime(srt) で試そう!/lets-play-anthropic-sandbox-runtime
tomoki10
1
500
2026TECHFRESH畢業分享會 - 葬送的通靈師:化系統與用戶雜訊成行動訊號
line_developers_tw
PRO
0
590
チームで進めるAI駆動アジャイル×ウォーターフォール
kumaiu
0
140
Disciplined Vibes: Scaling AI-Assisted Engineering
sheharyar
0
110
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
120
2026.06.13_AI時代に事業会社が「SIer出身エンジニア」を求める理由 / Why Businesses Seek Engineers with a System Integrator Background in the AI Era
jumtech
0
1k
なぜ Platform Engineering の土台に Kubernetes を選ぶのか
r4ynode
1
520
AWSシリコン最前線 〜AI時代のチップ選択を読み解く〜
htokoyo
2
360
「エンジニア進化論」2028年の開発完全自動化、エンジニアはどう進化するか
cyberagentdevelopers
PRO
4
3.2k
個人最適 から 全体最適 へ AI情報共有会・AIギルド・AI-DLC で進める カンリーの組織展開
rfdnxbro
0
2.1k
AIっぽい文章を採点して人間らしく直すアプリを作ってみた
yama3133
2
110
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
330
Featured
See All Featured
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.5k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
360
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
GitHub's CSS Performance
jonrohan
1033
470k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.7k
WCS-LA-2024
lcolladotor
0
620
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
How to train your dragon (web standard)
notwaldorf
97
6.7k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
380
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Transcript
バックエンドエンジニアか ら見たReact Ryota Suginaga
Agenda • Self-introduction • Back-end engineer worries • Want to
create a small web-app • My understanding of React • React beyond my understanding • Work efficiency tool • Summary 話さないこと • 他ライブラリやフレームワークとの比較 • Reactの機能詳細
Self-introduction 杉永良太(@transnano) ヤフー株式会社 バックエンドエンジニア(SRE) YAML > Shell > (超えられない壁) >
TypeScript > Ruby, Python, Perl, Java 以前:業務システム・アプリ、Java > C# > JavaScript 興味:クラウドネイティブ、Go > React (Reactについての理解が間違っていたら優しく教えてください)
Anai OMG!!
Back-end engineer worries CLIとかWebAPI、監視は得意 CUI(CLI)でもいいけど、GUI(Web)の方がやっぱり便利! ⇒Webアプリならインストールも要らないしね ⇒Push->デプロイの自動化・運用は任せて〜
Want to create a small web-app バックエンドAPIは秒で作るから、結果を表示する部分だけ作れれば。。。 ⇒そう、Reactならね
Try to start sample react-app $ npm i -g create-react-app
$ create-react-app myapp $ cd myapp $ yarn start
My understanding of React • React = Viewライブラリ ◦ 見た目の部分がやりたいから、今回の要件に合いそう
• component = class、state = instance variable、property = initialize value ◦ Java脳には理解しやすく、書きやすかった(後述) • Component Life-cycle ◦ これのおかげでビューの扱いが超絶簡単になっている(後述) • Styled component ◦ デザインとロジックをまとめられる、部品化しやすい、変数化されていたりもして改造できる ◦ Material-UIがあればコピペでビューができる
Compare React and Java class Parent extends React.Component { static
propTypes = { name: PropTypes.string.isRequired, age: PropTypes.int.isRequired, }; // コンストラクタで初期値をセット constructor(props) { super(props); // stateの初期値を設定 this.state = { name: this.props.name, age: this.props.age, }; } } class Human { String name; int age; // コンストラクタで初期値をセット Human(String name, int age) { super(); // クラス変数の初期値を設定 this.name = name; this.age = age; } }
Component life-cycle • componentDidMount() ◦ DOM構築後に走るイベントなので、ここで初回の API通信したり • componentDidUpdate(prevProps, prevState,
snapshot) ◦ propertyまたはstateが変わった時なので、 2回目以降のAPI通信したり ◦ prevPropsが前回の値でthis.propsが現在の値として比較可能 • componentWillUnmount() ◦ コンポーネントが使われなくなる時なので、終了処理したり • shouldComponentUpdate(nextProps, nextState) ◦ コンポーネントを再描画すべきかどうかの判定処理を入れたり
Next challenges • TypeScript(TSX) ◦ TSXだとProperty以外も型までしっかりと書けるため • SSR ◦ サーバサイドでもReactが使える嬉しい機能。
BFFやる時までには習得したい • Hooks ◦ Reactの新しい概念・機能で、簡潔に書ける /テストしやすくなるため
Work efficiency tool <画像を貼る> 1. 左テキストエリアのstateが変わったら APIにその内容を送信 2. レスポンスを右テキストエリアに表示 3.
コピー! で終わって、社内用ドキュメントに貼り付ける
Summary • ちょっと作るくらいならcreate-react-appで8割終わる ◦ 余談:裏がGoならgo-staikとかでReactの静的ファイル固めれば 1バイナリで配布できる • Java脳からはcomponent, state, propertyは理解しやすい
• propertyは型があって良い ◦ TSXはもっと良さそう • Styled componentだと1ファイルで済むから楽ちん(JSONで書けるし) Javaを噛ったことあるバックエンドエンジニアでも抵抗感少なく触れた