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
Introduction to React - Triangle.rb May 2015
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Nathan Hunzaker
May 12, 2015
Technology
210
0
Share
Introduction to React - Triangle.rb May 2015
The presentation I gave at Triangle.rb introducing React.
Nathan Hunzaker
May 12, 2015
More Decks by Nathan Hunzaker
See All by Nathan Hunzaker
React for Poets
nhunzaker
0
130
What is React?
nhunzaker
7
810
Other Decks in Technology
See All in Technology
MySQL 9.7がやってきた ~これまでのあらすじと基本情報~ @ 日本MySQLユーザ会会2026年04月 / mysql97-yattekita
sakaik
0
170
カオナビに Suspenseを導入するまで / The Road to Suspense at kaonavi
kaonavi
1
430
Forget technical debt
ufried
0
170
拝啓、あの夏の僕へ〜あなたも知っているApp Runnerの世界〜
news_it_enj
0
220
SLI/SLO、「完全に理解した」から「チョットデキル」へ
maruloop
1
120
Percolatorを廃止し、マルチ検索サービスへ刷新した話 / Search Engineering Tech Talk 2026 Spring
visional_engineering_and_design
0
330
会社説明資料|株式会社ギークプラス ソフトウェア事業部
geekplus_tech
0
190
(きっとたぶん)人材育成や教育のような何かの話
sejima
0
650
AI時代に越境し、 組織を変えるQAスキルの正体 / QA Skills for Transforming an Organization
mii3king
5
4.1k
サンプリングは「作る」のか「使う」のか? 分散トレースのコストと運用を両立する実践的戦略 / Why you need the tail sampling and why you don't want it
ymotongpoo
3
120
Databricks Academic Series 〜 大規模言語モデル / エージェント編 〜 / academic-series-llm
databricksjapan
0
110
サービスの信頼性を高めるため、形骸化した「プロダクションミーティング」を立て直すまでの取り組み
stefafafan
1
250
Featured
See All Featured
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
160
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.7k
Scaling GitHub
holman
464
140k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
270
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
3k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
340
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
Rails Girls Zürich Keynote
gr2m
96
14k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.4k
It's Worth the Effort
3n
188
29k
Transcript
React
Nate Hunzaker Front-end Developer, Viget @natehunzaker
We build lots of user interfaces
None
None
None
Every framework has a big idea
They don't just reinvent the wheel
“Backbone.js gives structure to web applications [...]”
“Ember.js is built for productivity. Designed with developer ergonomics in
mind...”
Keep it simple
“We can only hope to make reliable those things in
which we understand.” - Rich Hickey
• Composition • One way data flow • Static mental
model
Compo(sition,nents) "React is all about building reusable components. In fact,
with React the only thing you do is build components." - facebook.github.io/react
Encourage developers to break a user interface into small components.
<Blogs/> <Navigation/> <Posts/> <Post/> <Post/> <Post/> <Post/>
None
None
None
None
None
None
• No templates • Strange syntax
“Templates separate technology, not concerns.” - Pete Hunt (formerly of
Facebook)
None
JSX “The purpose of this specification is to define a
concise and familiar syntax for defining tree structures with attributes.” http://facebook.github.io/jsx/
None
None
None
How does this work?
None
None
npm install babel npm install react-tools
None
<main/> <Menu/> <Inbox/>
Virtual DOM
Build a DOM tree Compare to old state Get cheapest
mutation path (with Levenshtein) Write new DOM (in batches) New state
State changed! So what...
Imperative Programming Describe the transition between state
Declarative Programming Express the logic, not the flow
Define Interface Change State • Each change in state flushes
to the DOM • Properties are sent in one direction • No cascading updates
Let's talk about state
A component is given props A component manages state
A component is given props
A component manages state
That's kind of it
Static Rendering Model
This is fast
Holy Hot Modules! https://github.com/gaearon/react-hot-loader
Really fast
Static Mental Model
When you render to a virtual environment, the DOM becomes
an implementation detail
None
None
What is an isomorphic?
None
React.render() is idempotent Same in, same out
None
None
React.renderToStaticMarkup
None
How do I build real apps with this?
Flux “Flux [...] complements React's composable view components by utilizing
a unidirectional data flow.” http://facebook.github.io/flux/
None
I thought you said this was simple
Job Queue State State State I want to create a
widget Ready a widget! I can totally do that! Ch-ch-ch-ch- changes I love David Bowie!
Flux Formal Capacitor: A demo isomorphic Flux app https://github.com/vigetlabs/capacitor
Flux Fun http://www.natehunzaker.com/yappy-bird/
App State Stimuli New state
Initial State Sound Jump()
None
None
None
None
NuclearJS https://github.com/optimizely/nuclear-js Yahoo Flux https://github.com/yahoo/flux-examples Om (Clojurescript) https://github.com/swannodette/om
On that note...
React injects a few constraints that yield powerful benefits
By focusing on composability and a single direction flow of
data, we can greatly simplify our apps
Hopefully you didn't ignore me after the JSX :)
Thanks! Nate Hunzaker Front-end Developer, Viget @natehunzaker
Iconography: User interface icon by Aziz, the Noun Project http://thenounproject.com/azisher
JavaScript Logo: https://github.com/voodootikigod/logo.js General React Concepts: React Homepage http://facebook.github.io/react/ JSX Specification http://facebook.github.io/jsx/ Rethinking Best Practices, Pete Hunt: https://www.youtube.com/watch?v=x7cQ3mrcKaY Decomplexifying Code with React, Steven Luscher: https://www.youtube.com/watch?v=rI0GQc__0SM An Introduction to ReactJS, James Pierce https://www.youtube.com/watch?v=m2fuO2wl_3c Flux Flux Homepage http://facebook.github.io/flux/ Examples React Fun https://github.com/nhunzaker/react-fun React Animatable https://github.com/nhunzaker/react- animatable An Isomorphic Chart https://github.com/nhunzaker/an- isomorphic-chart Capacitor https://github.com/vigetlabs/capacitor Yappy Bird https://github.com/nhunzaker/yappy-bird
react-router: the best router https://github.com/rackt/react-router