SlideShare a Scribd company logo
React JS
This Guy 
• Software Engineer at feature[23] 
• I can haz degrees in muzak and puterz 
• I beer, fish, and party on guitars 
• I currently dig FRP, IOT, and JS (the good parts…)
So, What Is React? 
• A JavaScript library for building User Interfaces* 
• It was created by the engineering team at facebook 
• https://code.facebook.com/projects/ 
• A (Smart) View Engine of sorts 
• It is not a client-side, MVC/MVVM/MW*, framework
What Does React Do? 
• React renders your UI 
• React responds to user interactions 
• React reduces complexity 
• React tackles performance issues for you, behind the scenes
This Sounds Familiar 
• It is… and isn’t 
• http://www.todomvc.com 
• Two-way data binding is great… and isn’t 
• Cascading effects and interdependent data 
• State over time 
• Templates are great… until they aren’t 
• Constrained Template Engines/Languages 
• Cohesion over Coupling 
• Templates don’t respect state 
• Frameworks are great… and aren’t 
• Just a View Engine, and just JavaScript 
• Truly reusable and plays nicely with existing frameworks and libraries 
• No esoteric concepts
React Concepts Notions 
• Components 
• Manage their own state 
• Handle interactions through explicit and declarative events 
• Separate responsibilities 
• Higher maintainability 
• Great for debugging 
• Great for testing 
• Props 
• Data that is passed to a component 
• Immutable 
• State 
• Immutable… sort of 
• this.setState() 
• “Re-render” entire app on state change 
• This sounds horribly inefficient… 
No esoteric concepts?!?! 
…these aren’t new concepts
Virtual DOM 
(this is) 
• A virtual, in memory, representation of the real DOM 
• Changes in the real DOM trigger changes to the state of your React 
Component 
• When state changes, React creates a new representation of the virtual 
DOM based on what has changed. 
• React diffs between the original representation and the new 
representation of the Virtual DOM. 
• React determines the minimal set of operations necessary to update the 
real DOM and batch processes them as a patch to the real DOM. 
• In effect, you have “re-rendered” your application, but you haven’t lost any 
state in the real DOM (scroll position, timers, etc.)
Why a Virtual DOM? 
• Because the real DOM is slow and clunky 
• …and you don’t know all the implications of changing DOM or Style 
• http://www.csstriggers.com 
• Because “re-rendering” your entire application every time state changes would be unbelievably slow (a la 
1990s style page refreshes) in the modern web. 
• But those 90s people had some things right 
• Wrapping state around a stateless protocol is...  
• Diffing Immutable Data Structures is fast 
• http://en.wikipedia.org/wiki/Hash_array_mapped_trie 
• You only update the path/parts that changed 
• Browser Compatibility and Normalization 
• Fix all the things! (that the DOM is horrible at)
Heuristics 
• Accepted rules to allow for O(N) diffing computation 
• Versus O(N3) 
• Keys 
• Seriously, a lack of keys will cause crazy behavior 
• Without keys, React won’t be able to know about dynamic DOM updates 
• Single Node 
• Components must return a single node 
• Can return any number of nodes within that 
• Use parentheses (just do it) 
• Component Levels 
• Components should never move vertically
JSX 
• Completely Optional 
• XML-usg syntactic sugar 
• Easier to reason about for engineers 
• Easier for designers to contribute 
• Give it a try
JSX
JSX
Gotchas 
• Including JSX Transformer 
• <script type=“text/jsx”></script> 
• <div style={wtf}></div> 
• <div className={wtf}></div> 
• ClassSet makes up for this annoyance 
• Components must return a single element 
• Auto-binding of this and closures 
• KEYS 
• Seriously, these are crucial 
• Must be unique
Why Use It? 
• Portable/Agnostic 
• Performance 
• Maintenance 
• Comprehensible 
• Testable
Demo
ReactJS Code Impact
Resources 
• YouTubez 
• David Nolen: Immutability, Interactivity, and JavaScript 
• Tom Occhino and Jordan Walke: Introduction to ReactJS 
• Pete Hunt: Rethinking Best Practices 
• Steven Luscher: Developing User Interfaces with ReactJS 
• Just look up ‘ReactJS’ on YouTube, there are some other great videos 
• Links 
• ReactJS 
• ReactJS.NET 
• Flux 
• Virtual DOM
Flux
ReactJS Code Impact

More Related Content

What's hot (20)

PPTX
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
PDF
Increasing performance with Elixir Tasks
Jeffrey Chan
 
PDF
The New JavaScript: ES6
Rob Eisenberg
 
PDF
Understanding Redux — Ilya Gelman
500Tech
 
PDF
Angular2 vs React
Osman SELVİ
 
PDF
Understanding Facebook's React.js
Federico Torre
 
PDF
[CocoaHeads Tricity] Michał Zygar - Consuming API
CocoaHeads Tricity
 
PDF
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
PDF
Server side rendering for any JS framework
Adam L Barrett
 
PPSX
React introduction
Kashyap Parmar
 
PDF
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
PPTX
From Imperative to Functional Programming (for Absolute Beginners)
Alex Bunardzic
 
PDF
Developing, building, testing and deploying react native apps
Leena N
 
PDF
Munchkin
Jaewe Heo
 
PDF
Akka - Developing SEDA Based Applications
Benjamin Darfler
 
PPTX
NTBT #1 "Client-Side JavaScript"
Frédéric Ghilini
 
PDF
Hello world - intro to node js
Refresh Annapolis Valley
 
PDF
Dynamic input tables lwc vs aura vs. visualforce
Mike Tetlow
 
PPTX
Vlad zelinschi optimizing the critical rendering path
Codecamp Romania
 
PDF
Kevin Whinnery: Write Better JavaScript
Axway Appcelerator
 
How NOT to get lost in the current JavaScript landscape
Radosław Scheibinger
 
Increasing performance with Elixir Tasks
Jeffrey Chan
 
The New JavaScript: ES6
Rob Eisenberg
 
Understanding Redux — Ilya Gelman
500Tech
 
Angular2 vs React
Osman SELVİ
 
Understanding Facebook's React.js
Federico Torre
 
[CocoaHeads Tricity] Michał Zygar - Consuming API
CocoaHeads Tricity
 
React Native Introduction: Making Real iOS and Android Mobile App By JavaScript
Kobkrit Viriyayudhakorn
 
Server side rendering for any JS framework
Adam L Barrett
 
React introduction
Kashyap Parmar
 
Breaking the Server-Client Divide with Node.js and React
Dejan Glozic
 
From Imperative to Functional Programming (for Absolute Beginners)
Alex Bunardzic
 
Developing, building, testing and deploying react native apps
Leena N
 
Munchkin
Jaewe Heo
 
Akka - Developing SEDA Based Applications
Benjamin Darfler
 
NTBT #1 "Client-Side JavaScript"
Frédéric Ghilini
 
Hello world - intro to node js
Refresh Annapolis Valley
 
Dynamic input tables lwc vs aura vs. visualforce
Mike Tetlow
 
Vlad zelinschi optimizing the critical rendering path
Codecamp Romania
 
Kevin Whinnery: Write Better JavaScript
Axway Appcelerator
 

Similar to ReactJS Code Impact (20)

PDF
Welcome to React & Flux !
Ritesh Kumar
 
PPTX
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
PDF
React & Flux Workshop
Christian Lilley
 
PPTX
Introduction to React JS.pptx
SHAIKIRFAN715544
 
PPTX
reactJS
Syam Santhosh
 
PPT
React js
Jai Santhosh
 
PPTX
React.js at Cortex
Geoff Harcourt
 
PPTX
React + Flux = Joy
John Need
 
PPTX
ReactJS.NET - Fast and Scalable Single Page Applications
Rick Beerendonk
 
PPTX
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
PPTX
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
PPTX
React js
Nikhil Karkra
 
PDF
Intro to react_v2
Feather Knee
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PPTX
ReactJS
Ram Murat Sharma
 
PDF
React && React Native workshop
Stacy Goh
 
PDF
React Tech Salon
Chenguang ZHANG
 
PDF
ReactJS - A quick introduction to Awesomeness
Ronny Haase
 
PDF
React JS and why it's awesome
Andrew Hull
 
PPTX
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
 
Welcome to React & Flux !
Ritesh Kumar
 
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
React & Flux Workshop
Christian Lilley
 
Introduction to React JS.pptx
SHAIKIRFAN715544
 
reactJS
Syam Santhosh
 
React js
Jai Santhosh
 
React.js at Cortex
Geoff Harcourt
 
React + Flux = Joy
John Need
 
ReactJS.NET - Fast and Scalable Single Page Applications
Rick Beerendonk
 
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
React js
Nikhil Karkra
 
Intro to react_v2
Feather Knee
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
React && React Native workshop
Stacy Goh
 
React Tech Salon
Chenguang ZHANG
 
ReactJS - A quick introduction to Awesomeness
Ronny Haase
 
React JS and why it's awesome
Andrew Hull
 
React, Flux and a little bit of Redux
Ny Fanilo Andrianjafy, B.Eng.
 
Ad

Recently uploaded (20)

PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
July Patch Tuesday
Ivanti
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Biography of Daniel Podor.pdf
Daniel Podor
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Ad

ReactJS Code Impact

  • 2. This Guy • Software Engineer at feature[23] • I can haz degrees in muzak and puterz • I beer, fish, and party on guitars • I currently dig FRP, IOT, and JS (the good parts…)
  • 3. So, What Is React? • A JavaScript library for building User Interfaces* • It was created by the engineering team at facebook • https://code.facebook.com/projects/ • A (Smart) View Engine of sorts • It is not a client-side, MVC/MVVM/MW*, framework
  • 4. What Does React Do? • React renders your UI • React responds to user interactions • React reduces complexity • React tackles performance issues for you, behind the scenes
  • 5. This Sounds Familiar • It is… and isn’t • http://www.todomvc.com • Two-way data binding is great… and isn’t • Cascading effects and interdependent data • State over time • Templates are great… until they aren’t • Constrained Template Engines/Languages • Cohesion over Coupling • Templates don’t respect state • Frameworks are great… and aren’t • Just a View Engine, and just JavaScript • Truly reusable and plays nicely with existing frameworks and libraries • No esoteric concepts
  • 6. React Concepts Notions • Components • Manage their own state • Handle interactions through explicit and declarative events • Separate responsibilities • Higher maintainability • Great for debugging • Great for testing • Props • Data that is passed to a component • Immutable • State • Immutable… sort of • this.setState() • “Re-render” entire app on state change • This sounds horribly inefficient… No esoteric concepts?!?! …these aren’t new concepts
  • 7. Virtual DOM (this is) • A virtual, in memory, representation of the real DOM • Changes in the real DOM trigger changes to the state of your React Component • When state changes, React creates a new representation of the virtual DOM based on what has changed. • React diffs between the original representation and the new representation of the Virtual DOM. • React determines the minimal set of operations necessary to update the real DOM and batch processes them as a patch to the real DOM. • In effect, you have “re-rendered” your application, but you haven’t lost any state in the real DOM (scroll position, timers, etc.)
  • 8. Why a Virtual DOM? • Because the real DOM is slow and clunky • …and you don’t know all the implications of changing DOM or Style • http://www.csstriggers.com • Because “re-rendering” your entire application every time state changes would be unbelievably slow (a la 1990s style page refreshes) in the modern web. • But those 90s people had some things right • Wrapping state around a stateless protocol is...  • Diffing Immutable Data Structures is fast • http://en.wikipedia.org/wiki/Hash_array_mapped_trie • You only update the path/parts that changed • Browser Compatibility and Normalization • Fix all the things! (that the DOM is horrible at)
  • 9. Heuristics • Accepted rules to allow for O(N) diffing computation • Versus O(N3) • Keys • Seriously, a lack of keys will cause crazy behavior • Without keys, React won’t be able to know about dynamic DOM updates • Single Node • Components must return a single node • Can return any number of nodes within that • Use parentheses (just do it) • Component Levels • Components should never move vertically
  • 10. JSX • Completely Optional • XML-usg syntactic sugar • Easier to reason about for engineers • Easier for designers to contribute • Give it a try
  • 11. JSX
  • 12. JSX
  • 13. Gotchas • Including JSX Transformer • <script type=“text/jsx”></script> • <div style={wtf}></div> • <div className={wtf}></div> • ClassSet makes up for this annoyance • Components must return a single element • Auto-binding of this and closures • KEYS • Seriously, these are crucial • Must be unique
  • 14. Why Use It? • Portable/Agnostic • Performance • Maintenance • Comprehensible • Testable
  • 15. Demo
  • 17. Resources • YouTubez • David Nolen: Immutability, Interactivity, and JavaScript • Tom Occhino and Jordan Walke: Introduction to ReactJS • Pete Hunt: Rethinking Best Practices • Steven Luscher: Developing User Interfaces with ReactJS • Just look up ‘ReactJS’ on YouTube, there are some other great videos • Links • ReactJS • ReactJS.NET • Flux • Virtual DOM
  • 18. Flux

Editor's Notes

  • #4: JavaScript Library Created By Facebook =>It was open sourced in mid-2013 =>Currently at version 0.11.1 Smart View Engine =>Smart View Engine: Think “controller-views”, I know, that sounds awfully coupled, doesn’t it? What it is NOT =>Comparing React to Angular or Ember is like comparing apples and fruit markets (thanks reddit) *When I say large applications, I mean really large applications with rich user experiences, not just LOB applications that need some small JS widgets here and there. ? Who is currently maintaining a seriously large application with a metric shit ton of JavaScript? You may want to consider React.
  • #5: React Renders your UI React presents what your View should look like at a given point in time React Responds to User Interactions =>And responds to user interactions. Think of it as a more declarative jQuery. =>Prevents unwanted state Reduces Complexity =>React encourages you to write Components with SRP in mind, versus writing a bunch of spaghetti JavaScript and trying to mitigate changes in data over time. Performance =>React has a ton of performance benefits that you get for free, I’ll discuss these in depth a bit later
  • #6: There are a lot of client-side JS frameworks… a lot Two Way Data Binding Two way data-binding isn’t always a bad thing, it has its place, like everything else But JavaScript is based on the von Neumann model of computing, meaning data only flows in one direction You assign values right to left. Building a two-way data binding abstraction fights this aspect of the language It also makes it more difficult to reason about the program, since data flies in and out modules in multiple directions And performance is hard to think about with regard to cascading updates When it works, 2-way data binding is great, when it doesn’t, it’s difficult to deal with. React does have two way data binding (of sorts) if you want it Templating You’re handcuffed by whatever your Template Engine of choice provides to you With React, you have the full arsenal of JS at your disposal to decide how your data should be rendered Templates aren’t really separating concerns, but technologies You’re already on the client, you’re in the View You write JavaScript, or use JS frameworks to manipulate HTML, so you’re writing JS-based display logic, hence, it’s a View/Display concern React favors and accepts this level of coupling because it’s inherently cohesive for your JS and Display Logic to live together After all, JS was written to work with the browser. You know, that thing that presents your View… Frameworks Because React is a library, and it is written to be truly agnostic, you can use it with any existing framework (or your own implementation) All it cares about is rendering data Many frameworks contain specialized concepts that engineers have to learn and deal with in order to make their underlying implementation work. There are a lot of leaky abstractions in these frameworks React has one leaky abstraction
  • #7: ***These aren’t esoteric, as they are nothing new in terms of programming concepts*** Components Think of the events as a more declarative jQuery If you find yourself heaping too much responsibility into a Component, create a new one Should model the hierarchy of your data Props Simply put, props are the data you want to render, typically passed in from the server or an external service Should be treated as an immutable data structure State State should also be thought of as immutable, but state will change through calls to this.setState() You pass in what the new state of the object should be, and your component will re-render itself with the new state/data Sounds horribly inefficient, right? Virtual DOM
  • #8: Virtual DOM This is a new concept, but you don’t really have to worry about it, learn about it, or know anything about it outside of a basic understanding of what it’s doing for you. And honestly, if you don’t know what the DOM is, and can’t discern what a virtual DOM is, maybe you shouldn’t be doing this…
  • #14: You need to include the JSXTransformer.js along with the react.js file in order to develop with JSX text/jsx for JSX based script Should compile to JS for deployment, see, React Compiler Inline styles are bad anyway, and you shouldn’t use them, but it’s not a horrible hindrance to use objects for style className is a minor inconvenience, but no big deal, classSet is an awesome add on Components should only ever return a single element (have to wrap everything) Keys are super important. They’re the way that dynamic elements are differentiated between renders, so when you’re diffing between renders and you have two collections, how would your collection determine where to place the new item(s)?