Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Data driven rendering
Search
Marc Tamlyn
February 17, 2016
Technology
1
190
Data driven rendering
An introduction to ReactJS given at JSOxford
Marc Tamlyn
February 17, 2016
Tweet
Share
More Decks by Marc Tamlyn
See All by Marc Tamlyn
Arousal and Anxiety
mjtamlyn
1
81
Working with Children
mjtamlyn
1
93
Wallingford Castle Archers Incorporation
mjtamlyn
0
200
Observation and Evaluation
mjtamlyn
0
130
Weird and Wonderful things to do with the ORM
mjtamlyn
3
1.4k
An Introduction to Graphene and Relay
mjtamlyn
6
1.2k
Tech Interviews that don't suck
mjtamlyn
4
1.1k
What's new in Django 1.9
mjtamlyn
1
210
Django Development Milestones
mjtamlyn
1
180
Other Decks in Technology
See All in Technology
SREが取り組むデプロイ高速化 ─ Docker Buildを最適化した話
capytan
0
130
M&Aで拡大し続けるGENDAのデータ活用を促すためのDatabricks権限管理 / AEON TECH HUB #22
genda
0
230
AI with TiDD
shiraji
1
260
TED_modeki_共創ラボ_20251203.pdf
iotcomjpadmin
0
140
Building Serverless AI Memory with Mastra × AWS
vvatanabe
0
370
Oracle Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
1
390
AIエージェント開発と活用を加速するワークフロー自動生成への挑戦
shibuiwilliam
4
810
Knowledge Work の AI Backend
kworkdev
PRO
0
170
松尾研LLM講座2025 応用編Day3「軽量化」 講義資料
aratako
1
960
さくらのクラウド開発ふりかえり2025
kazeburo
2
620
SQLだけでマイグレーションしたい!
makki_d
0
1.2k
ESXi のAIOps だ!2025冬
unnowataru
0
310
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
7.8k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.3k
Darren the Foodie - Storyboard
khoart
PRO
0
1.9k
Typedesign – Prime Four
hannesfritz
42
2.9k
The Invisible Side of Design
smashingmag
302
51k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.1k
First, design no harm
axbom
PRO
1
1.1k
What's in a price? How to price your products and services
michaelherold
246
13k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
How Software Deployment tools have changed in the past 20 years
geshan
0
30k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.8k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
80
Transcript
Data driven rendering An introduction to ReactJS Marc Tamlyn Photo
by Konstans Zafeiri on photocrowd.com
None
This is not •Babel •Webpack •Browserify •Flux •Redux •Relay
Motivation
None
Motivation •Responsive to input changes •Interactivity •Rendering only •Not a
jQuery mess!
What is React? •View layer of a traditional MVC •Virtual
DOM •Single directional data flow
What is a Component? •Takes input (props) •Returns an element
•Class with a render() method
What is a Component? var Photo = React.createClass({ render: function()
{ return React.createElement('img', { src: this.props.imageSrc, }); } });
Components with children var Photos = React.createClass({ render: function() {
var photos = this.props.photos.map((photo) => { return React.createElement(Photo, { imageSrc: photo.imageSrc, }); }); return React.createElement('div', {}, photos); } });
JSX •Preprocessor for React.createElement() •Compile using your JS preprocessor of
choice
JSX var Photos = React.createClass({ render: function() { var photos
= this.props.photos.map((photo) => { return <Photo imageSrc={photo.imageSrc} /> }); return <div>{photos}</div>; } });
Virtual DOM •Renders in memory-light virtual DOM •Compares changes between
trees •Flushes only changes to the document •Debounces rendering
Data flow •Components have state as well as props •Minimise
use of state •Handle at top level and pass functions around •Handle externally altogether!
Data flow var Photos = React.createClass({ getInitialState: function() { return
{photos: this.props.photos}; }, onLove: function() { … }, render: function() { var photos = this.state.photos.map((photo) => { return <Photo imageSrc={photo.imageSrc} onLove={this.onLove} /> }); return <div>{photos}</div>; } });
Data flow var Photo = React.createClass({ render: function() { return
<div> <img src={this.props.imageSrc} /> <a onclick={this.props.onLove}>Love</a> </div>; } });
Data flow •YOUR CHOICE •External communication
Example time!
$.fn.reactify <div data-react-component="Photos" data-react-props="{{ photos_json }}"></div> <script> $(document).reactify(); </script>
Work with us photocrowd.com/jobs
Thank you github.com/mjtamlyn twitter.com/mjtamlyn photocrowd.com/mjtamlyn