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
Reactjs @ MOSUT x Tainan.py
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Yuanhsiang Cheng
August 25, 2014
Technology
360
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Reactjs @ MOSUT x Tainan.py
Yuanhsiang Cheng
August 25, 2014
More Decks by Yuanhsiang Cheng
See All by Yuanhsiang Cheng
How to rebuild a websocket service by golang and redis
yhsiang
0
1.1k
From React to React Native Web
yhsiang
0
220
Rethink React in Elm
yhsiang
0
1.1k
開源與工程師的自我修養
yhsiang
0
230
Sayit in Taiwan
yhsiang
0
210
LY sayit
yhsiang
0
190
Webpack pack your web
yhsiang
17
12k
2015 Summer of ?
yhsiang
0
330
How to be a good wan-jun
yhsiang
1
190
Other Decks in Technology
See All in Technology
クラウドファンディング版StackChan 3体(4体)をインタラクティブな体験型作品にして展示もした話 / スタックチャンお誕生日会2026
you
PRO
0
270
プロンプト_きのこカンファレンス2026_LT
yurufuwahealer
0
120
本当の”仕事”を手放せる未来が見えた
mu7889yoon
0
220
Text-to-SQLをAgentCoreで実現し、生成されるSQLの精度を定量的に評価する
yakumo
2
430
Keeping applications secure by evolving OAuth 2.0 and OpenID Connect
ahus1
PRO
1
120
なぜ私たちのSREプラクティスはなかなか機能しないのか 〜システムより先に組織を見る〜 / Why our SRE practices aren't really working
vtryo
0
110
SRE歴2ヶ月でも開発6年の知見を活かして、チームで止まっていた環境改善を前に進めた話
a_ono
0
170
フルAIで個人開発して学んだあれこれ / yuruai vol.1
isaoshimizu
0
170
攻撃者がいなくてもAIエージェントはインシデントを起こす
nomizone
0
190
AIで政治は変わるのか? — 中高生と考えたAI時代の民主主義(東海高校サタデープログラム)
eitarosuda
0
360
cccccc
moznion
0
1.6k
デジタル・デザイン:次の50年を描く「進化する青写真」
y150saya
0
800
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.6k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
190
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
190
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
240
New Earth Scene 8
popppiees
3
2.4k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
4.1k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
62
44k
Leo the Paperboy
mayatellez
7
1.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.1k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
630
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.2k
Transcript
Reactjs yhsiang @ MOSUTxTainan.py 8/23 Sat.
Who am I?
〳腋僽㔔捀し➮㣖랔✫
HWꅾ䏞♳涗罏 将虋䊨玑䌌
React
MVC but V
templates but components
update DOM reconciliation
Features
Virtual DOM also render on server-side
Data Flow one-way reactive data
JSX XML-like syntax
var HelloMessage = React.createClass({ render: function({ return <div>Hello {this.props.name}</div>; });
}); React.renderComponent( <HelloMessage name="John" />, mountNode);
var HelloMessage = React.createClass({ render: function({ return ! }); });
React.renderComponent( , mountNode); React.DOM.div(null, “Hello “, this.props.name); HelloMessage({name: “John”})
React+LiveScript
{div} = React.DOM HelloMessage = React.createClass do render: -> div
{}, “Hello #{@props.name}” React.renderComponent ( HelloMessage name: ‘John’), mountNode
A stateful component
{div} = React.DOM Timer = React.createClass do getInitialState: -> secondsElapsed:
0 tick: -> @setState secondsElapsed: @state.secondsElapsed + 1 componentDidMount: -> @interval = setInterval @tick, 1000 componentWillUnmount: -> clearInterval @interval render: -> div {}, “Seconds Elapsed: #{@state.secondsElapsed}” React.renderComponent Timer!, mountNode
props vs state external v.s. internal
Lifecyle
componentWillMount() componentDidMount() componentWillReceiveProps() Mounting Updating this.getDOMnode(), setTimeout, xhr shouldComponentUpdate() componentWillUpdate()
componentDidUpdate() Unmounting componentWillUnmount()
{div} = React.DOM Timer = React.createClass do getInitialState: -> secondsElapsed:
0 tick: -> @setState secondsElapsed: @state.secondsElapsed + 1 componentDidMount: -> @interval = setInterval @tick, 1000 componentWillUnmount: -> clearInterval @interval render: -> div {}, “Seconds Elapsed: #{@state.secondsElapsed}” React.renderComponent Timer!, mountNode
React-boostrap
More? propTypes, mixins, statics
Flux application architecture
unidirectional data flow
Action Controller Model View Model Model Model Model View View
View View
Action Dispatcher Store View Action
https://github.com/facebook/flux
callbacks waitFor
Action Dispatcher action = type: ‘NEW_THREAD’ to: ‘hychen’ text: ‘嗨懂’
threadID: ‘78123’ messageID: ‘1234’ Message Store Thread Store Message View Thread View ‘78123’: participants: <[ hychen ly ]> messageList: <[ 1234 ]>
Action Dispatcher action = type: ‘NEW_THREAD’ to: ‘hychen’ text: ‘嗨懂’
threadID: ‘78123’ messageID: ‘1234’ Message Store Thread Store Message View Thread View ‘1234’: text: ‘嗨懂’ thread: ‘78123’ author: ‘ly’
flux, fluxxor, fluxy
reactjs.tw on Facebook @lyforever
CC-BY 4.0