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 first impressions
Search
Takashi Kanemoto
January 15, 2016
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React first impressions
カルテット開発部社内勉強会 LT 資料
Takashi Kanemoto
January 15, 2016
More Decks by Takashi Kanemoto
See All by Takashi Kanemoto
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
2
230
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
5
1.4k
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
560
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
1.3k
今年書いた技術記事で伸びたやつの自慢と自分の中では力作なのにさっぱり伸びなかったやつの供養 / My Tech Articles 2024
ttskch
2
210
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
48
44k
データベース/SQL超入門!完全初心者向けに世界一分かりやすく解説します
ttskch
2
8.2k
Symfony UX Autocompleteとかいう 顧客が本当に必要だったもの
ttskch
0
2.3k
就活生あるいは新人エンジニアさんへのお節介なアドバイス
ttskch
0
1.7k
Other Decks in Programming
See All in Programming
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
850
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
470
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
460
Vite+ Unified Toolchain for the Web
naokihaba
0
170
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
150
AIとRubyの静的型付け
ukin0k0
0
550
AI 時代のソフトウェア設計の学び方
masuda220
PRO
29
12k
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
520
Dataformのリポジトリを立ち上げるときにまずやること / dataform-day0-2026
snhryt
0
130
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
150
AI時代のUIはどこへ行く?その2!
yusukebe
19
6.9k
Copilot CLI の継戦能力を高める コンテキスト管理
nozomutu
1
1.2k
Featured
See All Featured
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
580
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Color Theory Basics | Prateek | Gurzu
gurzu
0
360
Site-Speed That Sticks
csswizardry
13
1.2k
Faster Mobile Websites
deanohume
310
31k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Marketing to machines
jonoalderson
1
5.4k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
200
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
For a Future-Friendly Web
brad_frost
183
10k
Transcript
React first impressions 2016.01.15 @qckanemoto 1 / 45
(1) What's that? 2 / 45
3 / 45
4 / 45
5 / 45
A JavaScript Library for Building User Interfaces 6 / 45
7 / 45
8 / 45
9 / 45
(2) Features? 10 / 45
11 / 45
12 / 45
13 / 45
14 / 45
15 / 45
16 / 45
17 / 45
(3) Example 18 / 45
var Hello = React.createClass({ render: function () { return <p>Hello,
React!</p>; } }); ReactDOM.render( <Hello />, document.getElementById('app') ); <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>React Example</title> <script src="//some/cdn/react.js"></script> <script src="//some/cdn/react-dom.js"></script> <script src="//some/cdn/babel-core/browser.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel" src="app.js"></script> </body> </html> 19 / 45
var Hello = React.createClass({ // It's called 'Component' render: function
() { return <p>Hello, React!</p>; } }); ReactDOM.render( <Hello />, document.getElementById('app') ); <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>React Example</title> <script src="//some/cdn/react.js"></script> <script src="//some/cdn/react-dom.js"></script> <script src="//some/cdn/babel-core/browser.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel" src="app.js"></script> </body> </html> 20 / 45
var Hello = React.createClass({ render: function () { return <p>Hello,
React!</p>; } }); ReactDOM.render( <Hello />, // Set the Component... document.getElementById('app') ); <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>React Example</title> <script src="//some/cdn/react.js"></script> <script src="//some/cdn/react-dom.js"></script> <script src="//some/cdn/babel-core/browser.min.js"></script> </head> <body> <div id="app"></div> <script type="text/babel" src="app.js"></script> </body> </html> 21 / 45
var Hello = React.createClass({ render: function () { return <p>Hello,
React!</p>; } }); ReactDOM.render( <Hello />, // Set the Component document.getElementById('app') // to the element '#app' ); <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>React Example</title> <script src="//some/cdn/react.js"></script> <script src="//some/cdn/react-dom.js"></script> <script src="//some/cdn/babel-core/browser.min.js"></script> </head> <body> <div id="app"></div> <!-- Here --> <script type="text/babel" src="app.js"></script> </body> </html> 22 / 45
23 / 45
Next step (2/5) 24 / 45
Use props var Hello = React.createClass({ render: function () {
return <p>Hello, React!</p>; } }); var Hello = React.createClass({ render: function () { return <p>Hello, <World name="React props" />!</p>; } }); var World = React.createClass({ render: function () { return <span>{this.props.name}</span>; } }); 25 / 45
26 / 45
props is that passed from parent. 27 / 45
Next step (3/5) 28 / 45
Use state var Hello = React.createClass({ render: function () {
return <p>Hello, <World name="React props" />!</p>; } }); var Hello = React.createClass({ getInitialState: function () { return { worldName: 'React state' }; }, render: function () { return <p>Hello, <World name={this.state.worldName} />!</p>; } }); 29 / 45
30 / 45
state is that held by itself. 31 / 45
Next step (4/5) 32 / 45
Change state var Hello = React.createClass({ getInitialState: function () {
return { worldName: 'React state' }; }, + // just change state after 1 sec + componentDidMount: function () { + var that = this; + setTimeout(function () { + that.setState({ worldName: 'Changed state' }); + }, 1000); + }, render: function () { return <p>Hello, <World name={this.state.worldName} />!</p>; } }); 33 / 45
34 / 45
35 / 45
When state updated component re-rendere whole tree under itself. 36
/ 45
Final step (5/5) 37 / 45
Make child stateful var World = React.createClass({ render: function ()
{ return <span>{this.props.name}</span>; } }); var World = React.createClass({ getInitialState: function () { return { name: this.props.name }; }, render: function () { return <span>{this.state.name}</span>; } }); 38 / 45
39 / 45
Not changed 40 / 45
props is immutable. state is mutable. 41 / 45
Conclusion 42 / 45
React is a JavaScript FW Component Oriented powered by One-way
Reactive Data Flow Virtual DOM Immutable props & Mutable state 43 / 45
Also has Two-way Binding And It's Necessary for some complicated
apps (I think) Similar to Angular2 ? 44 / 45
Thanks :) 45 / 45