SlideShare a Scribd company logo
REACT JS
A JAVASCRIPT LIBRARY FOR BUILDING USER INTERFACES
➤ Declarative
➤ Component-Based
➤ Learn Once, Write Anywhere
React is all about building components. The only thing to do with react is building components . They are incapsulated,
reusable and easy testing.
Imperative: $(button).removeClass('red').addClass('blue').
Declarative: this.setState({button: ‘blue’}); // color: this.state.button
It is a component oriented abstraction
FEATURES
➤ One-way data flow
➤ Virtual DOM
➤ JSX
➤ Architecture beyond HTML
➤ Simple semantics (props, state, lifecycle)
➤ React Native
virtual-dom is a collection of modules designed to provide a declarative way of representing the DOM for your app.
So instead of updating the DOM when your application state changes, you simply create a virtual tree or VTree,
which looks like the DOM state that you want.
JSX is a statically-typed, object-oriented programming language designed to run on modern web browsers.
Javascript XML based extension that compile just the template part of your code.
faster (12% faster on iOS 5.1, 29% faster on Android 2.3) / safer / easier ( offer solid class system )
The basic architecture of React applies beyond rendering HTML in the browser.
React architecture in IOS/Android native apps.
No classical MVC just COMPONENTS and one way data flow!!!
VS
VIRTUAL DOM Dom mirroring
RENDER CALLS ON EVERY STATE UPDATE
render: function () {
return <p> Hello {this.props.text}</p>;
}
➤ <p> - pure javascript, in-memory representation of DOM node
➤ render fires whenever something changes
PROPS AND STATE
PROPS - data that can be IMMUTABLE
const childComponent = React.createClass({

…

doStuff: function() {

this.props.foo = ‘smth else’; < error

}

})
STATE - data that can be MUTABLE
const childComponent = React.createClass({

…

doStuff: function() {

this.setState({foo: ’smth else’}); < ok

}

})
Components can get immutable data via props from parent components (flow)
or managed their own state via state…
React JS and Redux
React JS and Redux
INLINE STYLES
var divStyle = {
padding: 10,
margin: 10,
backgroundColor: this.props.bgcolor,
color: "#333",
display: "inline-block",
fontFamily: "monospace",
fontSize: "32",
textAlign: "center"
};
ReactDOM.render(<div style={divStyle}>Hello World!</div>, mountNode);
REACT COMPONENT AND PROPS
REACT COMPONENT AND STATE
MANAGING STATE AND COMPONENT LIFECYCLE
REACT ROUTING
React Router is a powerful routing library built on top of React that helps you add new screens
and flows to your application incredibly quickly, all while keeping the URL in sync with what's
being displayed on the page.
// First we import some modules...
import { Router, Route, IndexRoute, Link, hashHistory } from 'react-router'
render((
<Router history={hashHistory}>
<Route path="/" component={App}>
<IndexRoute component={Home} />
<Route path="about" component={About} />
<Route path="inbox" component={Inbox} />
</Route>
</Router>
), document.body)
PROS AND CONS
➤ License
"The license granted hereunder will terminate, automatically and without notice, if you initiate directly or indirectly, or
take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate
affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology,
product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the
Software. [...]
CONS
PROS
➤ Components are reusable anywhere in your app.
➤ Testing / Isolated components / Virtual DOM / Isomorphic
➤ Simple UI structure.
➤ It's not a full framework.
➤ It's kind of verbose.
Writing components isn't as straight forward as pure HTML & JS , everything inside component…
➤ It's not a full framework.

More Related Content

What's hot (20)

PPTX
Introduction to React JS for beginners
Varun Raj
 
PDF
Basics of React Hooks.pptx.pdf
Knoldus Inc.
 
PPTX
React with Redux
Stanimir Todorov
 
PDF
React and redux
Mystic Coders, LLC
 
PPTX
Introduction to react_js
MicroPyramid .
 
PPTX
React js
Oswald Campesato
 
PPTX
A Brief Introduction to React.js
Doug Neiner
 
PDF
Understanding react hooks
Samundra khatri
 
PPTX
React workshop
Imran Sayed
 
PPTX
React-JS Component Life-cycle Methods
ANKUSH CHAVAN
 
PDF
Redux Toolkit - Quick Intro - 2022
Fabio Biondi
 
PDF
React.js and Redux overview
Alex Bachuk
 
PPTX
reactJS
Syam Santhosh
 
PDF
ReactJS presentation
Thanh Tuong
 
PDF
Important React Hooks
Knoldus Inc.
 
PDF
Getting Started with NgRx (Redux) Angular
Gustavo Costa
 
PPTX
[Final] ReactJS presentation
洪 鹏发
 
PDF
React new features and intro to Hooks
Soluto
 
PPTX
React js
Alireza Akbari
 
PDF
React JS - Introduction
Sergey Romaneko
 
Introduction to React JS for beginners
Varun Raj
 
Basics of React Hooks.pptx.pdf
Knoldus Inc.
 
React with Redux
Stanimir Todorov
 
React and redux
Mystic Coders, LLC
 
Introduction to react_js
MicroPyramid .
 
A Brief Introduction to React.js
Doug Neiner
 
Understanding react hooks
Samundra khatri
 
React workshop
Imran Sayed
 
React-JS Component Life-cycle Methods
ANKUSH CHAVAN
 
Redux Toolkit - Quick Intro - 2022
Fabio Biondi
 
React.js and Redux overview
Alex Bachuk
 
reactJS
Syam Santhosh
 
ReactJS presentation
Thanh Tuong
 
Important React Hooks
Knoldus Inc.
 
Getting Started with NgRx (Redux) Angular
Gustavo Costa
 
[Final] ReactJS presentation
洪 鹏发
 
React new features and intro to Hooks
Soluto
 
React js
Alireza Akbari
 
React JS - Introduction
Sergey Romaneko
 

Similar to React JS and Redux (20)

PPTX
ReactJS (1)
George Tony
 
PPTX
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
PPTX
React.js - The Dawn of Virtual DOM
Jimit Shah
 
PPTX
React ppt
Naresh Thamizharasan
 
PPTX
React Workshop: Core concepts of react
Imran Sayed
 
PPTX
Up and Running with ReactJS
Loc Nguyen
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PPTX
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
PPTX
Introduction to React JS.pptx
SHAIKIRFAN715544
 
DOCX
Skill practical javascript diy projects
SkillPracticalEdTech
 
PPTX
React
manii kanta
 
PPTX
React js
Nikhil Karkra
 
PPTX
Mastering React: Building Modern and Interactive User Interfaces
medtechno1999
 
PPTX
React for JavaScipt Introduction and functions
MaithiliGogteParanja
 
PDF
React Fundamentals - Jakarta JS, Apr 2016
Simon Sturmer
 
PPTX
ReactJS Code Impact
Raymond McDermott
 
PPTX
Internal workshop react-js-mruiz
Miguel Ruiz Rodriguez
 
PDF
learning react
Eueung Mulyana
 
PDF
Review on React JS
ijtsrd
 
PDF
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
ReactJS (1)
George Tony
 
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
Karmanjay Verma
 
React.js - The Dawn of Virtual DOM
Jimit Shah
 
React Workshop: Core concepts of react
Imran Sayed
 
Up and Running with ReactJS
Loc Nguyen
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 
Introduction to React JS.pptx
SHAIKIRFAN715544
 
Skill practical javascript diy projects
SkillPracticalEdTech
 
React js
Nikhil Karkra
 
Mastering React: Building Modern and Interactive User Interfaces
medtechno1999
 
React for JavaScipt Introduction and functions
MaithiliGogteParanja
 
React Fundamentals - Jakarta JS, Apr 2016
Simon Sturmer
 
ReactJS Code Impact
Raymond McDermott
 
Internal workshop react-js-mruiz
Miguel Ruiz Rodriguez
 
learning react
Eueung Mulyana
 
Review on React JS
ijtsrd
 
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
Ad

Recently uploaded (20)

PPTX
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Agentforce World Tour Toronto '25 - Supercharge MuleSoft Development with Mod...
Alexandra N. Martinez
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
The 2025 InfraRed Report - Redpoint Ventures
Razin Mustafiz
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
How do you fast track Agentic automation use cases discovery?
DianaGray10
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Kit-Works Team Study_20250627_한달만에만든사내서비스키링(양다윗).pdf
Wonjun Hwang
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Ad

React JS and Redux

  • 1. REACT JS A JAVASCRIPT LIBRARY FOR BUILDING USER INTERFACES ➤ Declarative ➤ Component-Based ➤ Learn Once, Write Anywhere React is all about building components. The only thing to do with react is building components . They are incapsulated, reusable and easy testing. Imperative: $(button).removeClass('red').addClass('blue'). Declarative: this.setState({button: ‘blue’}); // color: this.state.button It is a component oriented abstraction
  • 2. FEATURES ➤ One-way data flow ➤ Virtual DOM ➤ JSX ➤ Architecture beyond HTML ➤ Simple semantics (props, state, lifecycle) ➤ React Native virtual-dom is a collection of modules designed to provide a declarative way of representing the DOM for your app. So instead of updating the DOM when your application state changes, you simply create a virtual tree or VTree, which looks like the DOM state that you want. JSX is a statically-typed, object-oriented programming language designed to run on modern web browsers. Javascript XML based extension that compile just the template part of your code. faster (12% faster on iOS 5.1, 29% faster on Android 2.3) / safer / easier ( offer solid class system ) The basic architecture of React applies beyond rendering HTML in the browser. React architecture in IOS/Android native apps.
  • 3. No classical MVC just COMPONENTS and one way data flow!!! VS
  • 4. VIRTUAL DOM Dom mirroring
  • 5. RENDER CALLS ON EVERY STATE UPDATE render: function () { return <p> Hello {this.props.text}</p>; } ➤ <p> - pure javascript, in-memory representation of DOM node ➤ render fires whenever something changes
  • 6. PROPS AND STATE PROPS - data that can be IMMUTABLE const childComponent = React.createClass({
 …
 doStuff: function() {
 this.props.foo = ‘smth else’; < error
 }
 }) STATE - data that can be MUTABLE const childComponent = React.createClass({
 …
 doStuff: function() {
 this.setState({foo: ’smth else’}); < ok
 }
 }) Components can get immutable data via props from parent components (flow) or managed their own state via state…
  • 9. INLINE STYLES var divStyle = { padding: 10, margin: 10, backgroundColor: this.props.bgcolor, color: "#333", display: "inline-block", fontFamily: "monospace", fontSize: "32", textAlign: "center" }; ReactDOM.render(<div style={divStyle}>Hello World!</div>, mountNode);
  • 12. MANAGING STATE AND COMPONENT LIFECYCLE
  • 13. REACT ROUTING React Router is a powerful routing library built on top of React that helps you add new screens and flows to your application incredibly quickly, all while keeping the URL in sync with what's being displayed on the page. // First we import some modules... import { Router, Route, IndexRoute, Link, hashHistory } from 'react-router' render(( <Router history={hashHistory}> <Route path="/" component={App}> <IndexRoute component={Home} /> <Route path="about" component={About} /> <Route path="inbox" component={Inbox} /> </Route> </Router> ), document.body)
  • 14. PROS AND CONS ➤ License "The license granted hereunder will terminate, automatically and without notice, if you initiate directly or indirectly, or take a direct financial interest in, any Patent Assertion: (i) against Facebook or any of its subsidiaries or corporate affiliates, (ii) against any party if such Patent Assertion arises in whole or in part from any software, technology, product or service of Facebook or any of its subsidiaries or corporate affiliates, or (iii) against any party relating to the Software. [...] CONS PROS ➤ Components are reusable anywhere in your app. ➤ Testing / Isolated components / Virtual DOM / Isomorphic ➤ Simple UI structure. ➤ It's not a full framework. ➤ It's kind of verbose. Writing components isn't as straight forward as pure HTML & JS , everything inside component… ➤ It's not a full framework.