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
260
LY sayit
yhsiang
0
210
Webpack pack your web
yhsiang
17
12k
2015 Summer of ?
yhsiang
0
350
How to be a good wan-jun
yhsiang
1
230
Other Decks in Technology
See All in Technology
1週間、Opus封印でお願いします
kintotechdev
0
340
Autonomous AI Lakehouse - Live AI Hubから始めるセキュアなAIデータ活用 -
oracle4engineer
PRO
2
160
CTO Night & Day Morning Session_AI-DLC:生成 AI 時代の開発プロセス変革
pikosan0000
0
120
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
220
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
120
AI時代、つくる力を自分たちの手に。 ──電通×KAG、アジャイルとAI駆動開発で挑む開発の変革
yuukiyo
3
410
仕様駆動開発の、その先へ。決める力と確かめる仕組み
inariku
0
110
DevelopersIO 2026 Tokyo 現時点の衛星通信サービスの現状を整理してみる
maroon1st
0
320
VLA-JEPA: Enhancing Vision-Language-Action Models with Latent World Models
takmin
0
360
Let's Change Our World—Again
snoozer05
PRO
6
710
Claude Code on Bedrock で統制をかける小ネタ集/claude-code-bedrock-governance-tips
emiki
1
13k
AI駆動開発におけるハーネスエンジニアリングの勘所
tsukuboshi
1
830
Featured
See All Featured
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
440
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
530
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
The Language of Interfaces
destraynor
162
27k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
650
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Abbi's Birthday
coloredviolet
4
10k
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