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
Data driven rendering
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Marc Tamlyn
February 17, 2016
Technology
1
200
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
90
Working with Children
mjtamlyn
1
110
Wallingford Castle Archers Incorporation
mjtamlyn
0
220
Observation and Evaluation
mjtamlyn
0
140
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.2k
What's new in Django 1.9
mjtamlyn
1
220
Django Development Milestones
mjtamlyn
1
190
Other Decks in Technology
See All in Technology
Phase07_実務適用
overflowinc
0
1.6k
BFCacheを活用して無限スクロールのUX を改善した話
apple_yagi
0
110
モジュラモノリス導入から4年間の総括:アーキテクチャと組織の相互作用について / Architecture and Organizational Interaction
nazonohito51
3
1.6k
スピンアウト講座01_GitHub管理
overflowinc
0
1.2k
欠陥分析(ODC分析)における生成AIの活用プロセスと実践事例 / 20260320 Suguru Ishii & Naoki Yamakoshi & Mayu Yoshizawa
shift_evolve
PRO
0
340
A Casual Introduction to RISC-V
omasanori
0
550
TypeScript 7.0の現在地と備え方
uhyo
7
2k
GitHub Copilot CLI で Azure Portal to Bicep
tsubakimoto_s
0
180
開発チームとQAエンジニアの新しい協業モデル -年末調整開発チームで実践する【QAリード施策】-
qa
0
160
20260320_JaSST26_Tokyo_登壇資料.pdf
mura_shin
0
110
Copilot 宇宙へ 〜生成AIで「専門データの壁」を壊す方法〜
nakasho
0
160
DMBOKを使ってレバレジーズのデータマネジメントを評価した
leveragestech
0
180
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
480
Discover your Explorer Soul
emna__ayadi
2
1.1k
For a Future-Friendly Web
brad_frost
183
10k
Test your architecture with Archunit
thirion
1
2.2k
Marketing to machines
jonoalderson
1
5k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
75
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
860
HDC tutorial
michielstock
1
580
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
300
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