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
Reactjs @ MOSUT x Tainan.py
Search
Yuanhsiang Cheng
August 25, 2014
Technology
370
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.2k
From React to React Native Web
yhsiang
0
250
Rethink React in Elm
yhsiang
0
1.1k
開源與工程師的自我修養
yhsiang
0
240
Sayit in Taiwan
yhsiang
0
250
LY sayit
yhsiang
0
210
Webpack pack your web
yhsiang
17
12k
2015 Summer of ?
yhsiang
0
340
How to be a good wan-jun
yhsiang
1
230
Other Decks in Technology
See All in Technology
React改造してみた
tsukina_7mochi
0
140
野蛮なアジャイル [サイボウズ発!]組織の常識を覆した反骨のスクラム実践記 / Barbaric Agile - Enterprise Agile Study Group
ama_ch
0
110
Tofu-Controller lightning talk @ Containerday 2026
gionn
0
130
CTO Night|NotionのAIエージェントとFDE
kzkhykw1991
0
260
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
1k
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
200
データエンジニアの次の戦場は "プロセスエンジニアリング"
sansantech
PRO
1
120
PHPカンファレンス関西の招待状 / Invitation to PHP Conference Kansai
ykanoh
0
220
⾮構造化データを価値に変える AI エージェント基盤とその組織
ivry_presentationmaterials
0
210
触りたくないデータに、どう触るか AI時代のRBACアクセスガバナンス
ivry_presentationmaterials
0
290
hackers_champloo_2026_tidb
makocchi
0
170
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
390
Featured
See All Featured
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
600
Tell your own story through comics
letsgokoyo
1
1.1k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
2
360
Building Adaptive Systems
keathley
44
3.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
371
20k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.2k
Rails Girls Zürich Keynote
gr2m
96
14k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
Large-scale JavaScript Application Architecture
addyosmani
516
110k
Designing for Performance
lara
612
70k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
310
Leo the Paperboy
mayatellez
10
2.4k
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