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 first impressions
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Takashi Kanemoto
January 15, 2016
Programming
190
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
380
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
5
1.7k
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
640
PHPとAPI Platformで作る本格的なWeb APIアプリケーション(入門編) / phpcon 2024 Intro to API Platform
ttskch
0
1.4k
今年書いた技術記事で伸びたやつの自慢と自分の中では力作なのにさっぱり伸びなかったやつの供養 / My Tech Articles 2024
ttskch
2
240
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
48
45k
データベース/SQL超入門!完全初心者向けに世界一分かりやすく解説します
ttskch
2
8.9k
Symfony UX Autocompleteとかいう 顧客が本当に必要だったもの
ttskch
0
2.4k
就活生あるいは新人エンジニアさんへのお節介なアドバイス
ttskch
0
1.7k
Other Decks in Programming
See All in Programming
Vue Fes Japan の “作る側”に関わってみて
naokihaba
0
160
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
npm との違いを手がかりにGo の依存管理を理解したい
optim
0
290
カツオ、ご期待ください
suneo3476
0
190
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
610
R8 の設定見直しでアプリサイズ削減
andpad
0
220
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
5
5.2k
The Rails Doctrine Decade
koic
2
590
Simple Storage Service(S3) is not simple
iwatsukayura
0
290
iOS 27でニュースアプリはどう変わる!? 〜日経電子版の新機能対応と、開発事例から〜
lynnswap
7
13k
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
Featured
See All Featured
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.6k
Making the Leap to Tech Lead
cromwellryan
135
10k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
570
Crafting Experiences
bethany
1
380
Paper Plane
katiecoart
PRO
5
54k
Mobile First: as difficult as doing things right
swwweet
225
10k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
How to train your dragon (web standard)
notwaldorf
96
6.9k
4 Signs Your Business is Dying
shpigford
187
23k
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