React
The Dawn of Virtual DOM
What is React
A JAVASCRIPT LIBRARY FOR BUILDING USER INTERFACES
Main Features
• Just V of MVC
• Virtual DOM
• One Way Data Flow
Background of React
• Started by Facebook in 2013
• Motivation - building large applications with data that
changes over time.
• Over 40k+ Star on Github and 645 contributors
• You are in a good company
Source - https://github.com/facebook/react/wiki/Sites-Using-React
Lets Get started
The most important thing
Virtual DOM
To understand this We need to first see
Real DOM
The Reason for performance
Real DOM
Disadvantage
DOM manipulation APIs are slow
Surprisingly 😟
All the framework do this on every update
Enter the Dawn of Virtual DOM
React DOM Update Strategy
React’s Virtual DOM Strategy
On every update to component
• React Builds New Virtual DOM Subtree
• Diff with the actual DOM
• Computes minimal DOM mutation
• Batch executes updates
Benefits
Minimal DOM manipulation calls
Batch execution saves a lot of computation
Super Fast Performance
React.js - The Dawn of Virtual DOM
Getting started with React
React Terminology
React Elements
(Basic Building Block)
var root = React.createElement('div');
React.js Main React Library
react-dom.js
Supporting library to generate DOM
notation
Factories
(Called internally by React Element)
function createFactory(type) {
return React.createElement.bind(null, type);
}
React Nodes Tree of React Element
React Components
var MyComponent = React.createClass({
render: function() {
...
}
});
(Encapsulated React Elements)
(You will use this the most)
React Recommends Use of JSX
What is JSX
ped, object-oriented programming language designed to run on m
In short
Its just like Type script and transpiles into Plain Javascript
Without JSX
With JSX
Recommended Build Tool
Webpack
• Bundles JS using require.js
• Minification, Linting, Production Build
• Loaders system allows easy
extensibility
• Just like gulp but more powerful
• Lets us use ES6 and ES7 features
• React tags are transformed
automatically using babel-react-
presets module
Demo Time
Props
• Props are like parameter to functions
• They make component super re-usable
• Way to pass info from one component to other component
• Includes props type validation to ensure sanity of data
Demo
STATE
• Holds the current state of the component
• Update in the state variable updates the component
• getInitialState and setState method for updating state
value
Demo
Refs
• Used to keep reference to components
• If callback function is passed, then callback is executed just
after the component mounts with component as parameter
• Possible application includes animation, finding specific
node
Component Specification
• render -> Required method. Returns ReactElement
• getInitialState -> Not Required, If we require some
default state for component
• getDefaultProps -> Not Required. If we want to set
default value of prop.
• propTypes -> Not Required. Allows the prop type
validation
Demo
Component Lifecycle
• componentWillMount -> Invoked before the initial rendering of component
• componentWillReceiveProps -> Invoked before the component receives the props
(not on initial render)
• componentDidUpdate -> Invoked immediately after the update of comports are
flushed to DOM
• componentDidMount -> Invoked after initial rendering of the component (Used
for fetching data from server)
• componentWillUpdate -> Called before rendering.
• shouldComponentUpdate -> Must return true (or) false. Called when new state (or)
props are being received.
• componentWillUnmount -> Called before component is unmounted
Advantages
Declarative Nature
numbers = [1,2,3,4]
total = 0
for(i=0; i<numbers.length; i++)
{
total = total + numbers[i]
}
Implicit Declarative
numbers = [1,2,3,4]
numbers.reduce(
function(previousValue, currentValue) {
return previousValue + currentValue;
});
• componentWillMount()
• componentWillReceiveProps( {NextProps} )
• componentDidUpdate( {PreviousProps} , {PreviousState} )
• componentDidMount()
• componentWillUnmount()
• getInitialState
Example
Advantages
Composition
• Rather than building one big component, React
allows to focus building mini components to
compose one big component out of it.
• Highly reusable code
Synthetic events
• Only single event listener is binded per component
• Results in less memory usage and improvement in perform
Plain Javascript
• Directive
• digest cycle
• Transclude function
• $scope and $rootScope
• $scope.$apply
We have all suffered our way through
Not anymore
React is pure javascript
Less time learning and more time implementing
Best in class dev tool
react-devtools
Growing Eco system
React-router Axios - Promise library
Redux
React-Desktop React-Native
react-material
Source - https://github.com/enaqx/awesome-react#components
countless more …….
React-select
Thank You

More Related Content

PPTX
Introduction to React
PDF
React JS - Introduction
PDF
The virtual DOM and how react uses it internally
PDF
React js
PPTX
React JS: A Secret Preview
PPTX
reactJS
PDF
An introduction to React.js
PPTX
Reactjs
Introduction to React
React JS - Introduction
The virtual DOM and how react uses it internally
React js
React JS: A Secret Preview
reactJS
An introduction to React.js
Reactjs

What's hot (20)

PPTX
Introduction to React JS for beginners
PPTX
React workshop
PPTX
What Is Virtual DOM In React JS.pptx
PPTX
Intro to React
PPTX
React js programming concept
PDF
Understanding react hooks
PPTX
Understanding react hooks
PPTX
React state
PPTX
React js for beginners
PPTX
React hooks
PPTX
Introduction to React JS for beginners | Namespace IT
PPTX
React hooks
PPTX
PDF
React and redux
PDF
React Context API
PPTX
React hooks
PPTX
React js - The Core Concepts
PPTX
Redux workshop
Introduction to React JS for beginners
React workshop
What Is Virtual DOM In React JS.pptx
Intro to React
React js programming concept
Understanding react hooks
Understanding react hooks
React state
React js for beginners
React hooks
Introduction to React JS for beginners | Namespace IT
React hooks
React and redux
React Context API
React hooks
React js - The Core Concepts
Redux workshop
Ad

Viewers also liked (20)

PDF
Why and How to Use Virtual DOM
PDF
React JS and why it's awesome
PPTX
React for .net developers
PDF
CSS 讀書會 - 1 (Grid system)
PDF
Styling Components with JavaScript: MelbCSS Edition
PDF
Javascript template & react js 初探
PDF
React entry
PPTX
Synchronizing application state using Virtual DOM trees
PPTX
Repaint & reflow
PDF
Introduction to React
PPTX
Intro to Web Map APIs
PPTX
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
PPTX
Introduction to React
PDF
ReactNativeを語る勉強会
PDF
Pjax 深入淺出
PPTX
PDF
From Back to Front: Rails To React Family
PDF
Webpack & React Performance in 16+ Steps
PDF
React Native - Workshop
PDF
Introduction to ReactJS
Why and How to Use Virtual DOM
React JS and why it's awesome
React for .net developers
CSS 讀書會 - 1 (Grid system)
Styling Components with JavaScript: MelbCSS Edition
Javascript template & react js 初探
React entry
Synchronizing application state using Virtual DOM trees
Repaint & reflow
Introduction to React
Intro to Web Map APIs
Digitaalisesti vaikuttavaksi. @HelsinkiUniUX -projektin tarina
Introduction to React
ReactNativeを語る勉強会
Pjax 深入淺出
From Back to Front: Rails To React Family
Webpack & React Performance in 16+ Steps
React Native - Workshop
Introduction to ReactJS
Ad

Similar to React.js - The Dawn of Virtual DOM (20)

PPTX
React and Flux life cycle with JSX, React Router and Jest Unit Testing
PDF
Optimizing your use of react life cycles by shedrack akintayo
PDF
React Native Firebase
PDF
Understanding Facebook's React.js
PPTX
Continuous Integration on AWS
PDF
Introduction to React, Flux, and Isomorphic Apps
PDF
React state management with Redux and MobX
PDF
Angular Application Testing
PDF
From MEAN to the MERN Stack
PDF
Building High-Performance Force.com Applications in React
PPTX
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
PPTX
Web Performance & Latest in React
PPTX
Introduction to React
PDF
React && React Native workshop
PPTX
Dyanaimcs of business and economics unit 2
PDF
Bundle deployment at state machine level - Ales Justin, JBoss
PPTX
PPTX
20171108 PDN HOL React Basics
PDF
React.js+Redux Workshops
PPTX
Introduction to React native
React and Flux life cycle with JSX, React Router and Jest Unit Testing
Optimizing your use of react life cycles by shedrack akintayo
React Native Firebase
Understanding Facebook's React.js
Continuous Integration on AWS
Introduction to React, Flux, and Isomorphic Apps
React state management with Redux and MobX
Angular Application Testing
From MEAN to the MERN Stack
Building High-Performance Force.com Applications in React
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Web Performance & Latest in React
Introduction to React
React && React Native workshop
Dyanaimcs of business and economics unit 2
Bundle deployment at state machine level - Ales Justin, JBoss
20171108 PDN HOL React Basics
React.js+Redux Workshops
Introduction to React native

Recently uploaded (20)

PDF
SBOM Document Quality Guide - OpenChain SBOM Study Group
PPTX
Phoenix Marketo User Group: Building Nurtures that Work for Your Audience. An...
PDF
How to Set Realistic Project Milestones and Deadlines
PDF
OpenColorIO Virtual Town Hall - August 2025
PPTX
MCP empowers AI Agents from Zero to Production
PDF
Difference Between Website and Web Application.pdf
PPTX
Post-Migration Optimization Playbook: Getting the Most Out of Your New Adobe ...
PDF
DOWNLOAD—IOBit Uninstaller Pro Crack Download Free
PPTX
ESDS_SAP Application Cloud Offerings.pptx
PPTX
Presentation - Summer Internship at Samatrix.io_template_2.pptx
PPTX
SQL introduction and commands, SQL joining
PDF
OpenTimelineIO Virtual Town Hall - August 2025
PPTX
SAP Business AI_L1 Overview_EXTERNAL.pptx
PPTX
Relevance Tuning with Genetic Algorithms
PDF
MaterialX Virtual Town Hall - August 2025
PPTX
FLIGHT TICKET API | API INTEGRATION PLATFORM
PDF
Streamlining Project Management in Microsoft Project, Planner, and Teams with...
PPTX
Advanced Heap Dump Analysis Techniques Webinar Deck
PPTX
Greedy best-first search algorithm always selects the path which appears best...
PDF
Coding with GPT-5- What’s New in GPT 5 That Benefits Developers.pdf
SBOM Document Quality Guide - OpenChain SBOM Study Group
Phoenix Marketo User Group: Building Nurtures that Work for Your Audience. An...
How to Set Realistic Project Milestones and Deadlines
OpenColorIO Virtual Town Hall - August 2025
MCP empowers AI Agents from Zero to Production
Difference Between Website and Web Application.pdf
Post-Migration Optimization Playbook: Getting the Most Out of Your New Adobe ...
DOWNLOAD—IOBit Uninstaller Pro Crack Download Free
ESDS_SAP Application Cloud Offerings.pptx
Presentation - Summer Internship at Samatrix.io_template_2.pptx
SQL introduction and commands, SQL joining
OpenTimelineIO Virtual Town Hall - August 2025
SAP Business AI_L1 Overview_EXTERNAL.pptx
Relevance Tuning with Genetic Algorithms
MaterialX Virtual Town Hall - August 2025
FLIGHT TICKET API | API INTEGRATION PLATFORM
Streamlining Project Management in Microsoft Project, Planner, and Teams with...
Advanced Heap Dump Analysis Techniques Webinar Deck
Greedy best-first search algorithm always selects the path which appears best...
Coding with GPT-5- What’s New in GPT 5 That Benefits Developers.pdf

React.js - The Dawn of Virtual DOM

  • 1. React The Dawn of Virtual DOM
  • 2. What is React A JAVASCRIPT LIBRARY FOR BUILDING USER INTERFACES Main Features • Just V of MVC • Virtual DOM • One Way Data Flow
  • 3. Background of React • Started by Facebook in 2013 • Motivation - building large applications with data that changes over time. • Over 40k+ Star on Github and 645 contributors • You are in a good company Source - https://github.com/facebook/react/wiki/Sites-Using-React
  • 4. Lets Get started The most important thing Virtual DOM To understand this We need to first see Real DOM The Reason for performance
  • 5. Real DOM Disadvantage DOM manipulation APIs are slow Surprisingly 😟 All the framework do this on every update
  • 6. Enter the Dawn of Virtual DOM React DOM Update Strategy
  • 7. React’s Virtual DOM Strategy On every update to component • React Builds New Virtual DOM Subtree • Diff with the actual DOM • Computes minimal DOM mutation • Batch executes updates
  • 8. Benefits Minimal DOM manipulation calls Batch execution saves a lot of computation Super Fast Performance
  • 10. Getting started with React React Terminology React Elements (Basic Building Block) var root = React.createElement('div'); React.js Main React Library react-dom.js Supporting library to generate DOM notation Factories (Called internally by React Element) function createFactory(type) { return React.createElement.bind(null, type); } React Nodes Tree of React Element React Components var MyComponent = React.createClass({ render: function() { ... } }); (Encapsulated React Elements) (You will use this the most)
  • 11. React Recommends Use of JSX What is JSX ped, object-oriented programming language designed to run on m In short Its just like Type script and transpiles into Plain Javascript Without JSX With JSX
  • 12. Recommended Build Tool Webpack • Bundles JS using require.js • Minification, Linting, Production Build • Loaders system allows easy extensibility • Just like gulp but more powerful • Lets us use ES6 and ES7 features • React tags are transformed automatically using babel-react- presets module
  • 14. Props • Props are like parameter to functions • They make component super re-usable • Way to pass info from one component to other component • Includes props type validation to ensure sanity of data Demo
  • 15. STATE • Holds the current state of the component • Update in the state variable updates the component • getInitialState and setState method for updating state value Demo
  • 16. Refs • Used to keep reference to components • If callback function is passed, then callback is executed just after the component mounts with component as parameter • Possible application includes animation, finding specific node
  • 17. Component Specification • render -> Required method. Returns ReactElement • getInitialState -> Not Required, If we require some default state for component • getDefaultProps -> Not Required. If we want to set default value of prop. • propTypes -> Not Required. Allows the prop type validation Demo
  • 18. Component Lifecycle • componentWillMount -> Invoked before the initial rendering of component • componentWillReceiveProps -> Invoked before the component receives the props (not on initial render) • componentDidUpdate -> Invoked immediately after the update of comports are flushed to DOM • componentDidMount -> Invoked after initial rendering of the component (Used for fetching data from server) • componentWillUpdate -> Called before rendering. • shouldComponentUpdate -> Must return true (or) false. Called when new state (or) props are being received. • componentWillUnmount -> Called before component is unmounted
  • 19. Advantages Declarative Nature numbers = [1,2,3,4] total = 0 for(i=0; i<numbers.length; i++) { total = total + numbers[i] } Implicit Declarative numbers = [1,2,3,4] numbers.reduce( function(previousValue, currentValue) { return previousValue + currentValue; }); • componentWillMount() • componentWillReceiveProps( {NextProps} ) • componentDidUpdate( {PreviousProps} , {PreviousState} ) • componentDidMount() • componentWillUnmount() • getInitialState Example
  • 20. Advantages Composition • Rather than building one big component, React allows to focus building mini components to compose one big component out of it. • Highly reusable code
  • 21. Synthetic events • Only single event listener is binded per component • Results in less memory usage and improvement in perform
  • 22. Plain Javascript • Directive • digest cycle • Transclude function • $scope and $rootScope • $scope.$apply We have all suffered our way through Not anymore React is pure javascript Less time learning and more time implementing
  • 23. Best in class dev tool react-devtools
  • 24. Growing Eco system React-router Axios - Promise library Redux React-Desktop React-Native react-material Source - https://github.com/enaqx/awesome-react#components countless more ……. React-select