SlideShare a Scribd company logo
Introduction to
ReactJS
AESHAN WIJETUNGE
Why use React.js?
 Simple
 Declarative
 Build Composable Components
Credits: https://facebook.github.io/react/docs/why-react.html
http://kognitio.com/why-is-spark-on-the-rise-does-it-meet-business-needs/lego/
Popularity
 Popularity of React has been pretty high since 2015
 Downloads : ~ 933,860 in the last month
Credits: https://twitter.com/mjasay/status/618185536381935616
Current state of web
development
 HTML Views implemented in a dynamic templating language e.g:
dustJS, JSP…
 Validation & other functionality in MVC UI frameworks like
BackboneJS
 This makes for very fragmented development…
BackBoneJS
View 1
Templates
BackBoneJS
View 2
/public/js /public/templates
View Templating: many
options
JSX: markup in Javascript
Component 1
Component 2
Componentization
 Ideal overview of a React web app
JSX
logic
state
Logic
JSX
include
A Basic Example : Objectives
 A simple component that takes a user input, validates
it and shows an error message upon an error.
 Render a React component
 Make it dynamic : so its reusable
 Make it interactive : add functionality
The end goal
Create the view
 JSX is the most common means of writing Views for
React.
Dynamic Views
 Seldom can components be static and hardcoded.
We’ll need to pass parameters into ours to make it
more re-useable. These are called props.
Under the hood: Virtual DOM
Credit http://madhukaudantha.blogspot.sg/2015/04/reactjs-and-virtual-
dom.html
Event handling
Event handler
Attach handler
Traversing the DOM Tree
 However we also need to access the DOM of the
elements within component
 To do this we need to use React refs
Credits: http://adam.merrifield.ca/presentations/dom_demystified/
Refs – Access the DOM
 Refs are a React feature for accessing and thus
manipulating the HTML DOM.
 Ref scope is limited to the React component
 They essentially reference DOM elements
<input ref=“first_name” name=“first_name” value=“5”/>
this.refs.first_name
Value = 5
Adding the DOM refs
Access the DOM
element via ref
Ref the DOM
element
State-fulness
Credits: http://odetocode.com/articles/460.aspx
Adding state-management
 Let’s add some new function methods
Initial state
Change state
Get the value
Live Demo!

More Related Content

What's hot (20)

PPTX
Its time to React.js
Ritesh Mehrotra
 
PPTX
Intro to React
Justin Reock
 
PPTX
Introduction to React JS for beginners | Namespace IT
namespaceit
 
PPTX
Introduction to react_js
MicroPyramid .
 
PDF
WEB DEVELOPMENT USING REACT JS
MuthuKumaran Singaravelu
 
PPTX
Reactjs
Neha Sharma
 
ODP
Introduction to ReactJS
Knoldus Inc.
 
PPTX
Introduction to React JS
Arnold Asllani
 
PPTX
ReactJs
Sahana Banerjee
 
PPTX
Reactjs
Mallikarjuna G D
 
PDF
React js
Rajesh Kolla
 
PPTX
ReactJS presentation.pptx
DivyanshGupta922023
 
PDF
Angular components
Sultan Ahmed
 
PPTX
React web development
Rully Ramanda
 
PPT
React js
Jai Santhosh
 
PDF
ReactJS
Hiten Pratap Singh
 
PPTX
React-JS.pptx
AnmolPandita7
 
PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
Its time to React.js
Ritesh Mehrotra
 
Intro to React
Justin Reock
 
Introduction to React JS for beginners | Namespace IT
namespaceit
 
Introduction to react_js
MicroPyramid .
 
WEB DEVELOPMENT USING REACT JS
MuthuKumaran Singaravelu
 
Reactjs
Neha Sharma
 
Introduction to ReactJS
Knoldus Inc.
 
Introduction to React JS
Arnold Asllani
 
React js
Rajesh Kolla
 
ReactJS presentation.pptx
DivyanshGupta922023
 
Angular components
Sultan Ahmed
 
React web development
Rully Ramanda
 
React js
Jai Santhosh
 
React-JS.pptx
AnmolPandita7
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 

Viewers also liked (11)

PDF
WFD POSTER LANDSCAPE
Lotte Riddy
 
PDF
Socialmediaexaminer.Com Facebook 101 Business Guide | Social Media Exam...
atetrainingexpo
 
PDF
British Gas Simply Thank You Jan 2015
Paul Suter - 07957 933 584
 
PPTX
The Missing Feature: Blockchain contracts
Aeshan Wijetunge
 
PDF
A novel label-free cocaine assay based on aptamer-wrapped single-walled carbo...
Nanomedicine Journal (NMJ)
 
PDF
2768 la nueva_regulación_2004-2005[1]
Derechoycienciasjurìdicas Unicen La Paz
 
DOCX
Media conversation! assignment (1)
Mamadi Jaiteh
 
PPTX
Company law –a new beginning
Neha Godara
 
DOCX
Helpful Work for Mathematics
laluls212
 
PDF
An Intense Overview of the React Ecosystem
Rami Sayar
 
PPTX
EXTENT-2015: Efficient Risk Control - Challenges & Techniques
Iosif Itkin
 
WFD POSTER LANDSCAPE
Lotte Riddy
 
Socialmediaexaminer.Com Facebook 101 Business Guide | Social Media Exam...
atetrainingexpo
 
British Gas Simply Thank You Jan 2015
Paul Suter - 07957 933 584
 
The Missing Feature: Blockchain contracts
Aeshan Wijetunge
 
A novel label-free cocaine assay based on aptamer-wrapped single-walled carbo...
Nanomedicine Journal (NMJ)
 
2768 la nueva_regulación_2004-2005[1]
Derechoycienciasjurìdicas Unicen La Paz
 
Media conversation! assignment (1)
Mamadi Jaiteh
 
Company law –a new beginning
Neha Godara
 
Helpful Work for Mathematics
laluls212
 
An Intense Overview of the React Ecosystem
Rami Sayar
 
EXTENT-2015: Efficient Risk Control - Challenges & Techniques
Iosif Itkin
 
Ad

Similar to Introduction to react js (20)

PDF
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
PPT
The Best Guide to Know What, Why, When to Use Is ReactJS
WeblineIndia
 
PDF
Master React in 20 Days !.pdf used for react
shameer200479
 
PDF
React js vs react native a comparative analysis
Shelly Megan
 
PDF
React Interview Question PDF By ScholarHat
Scholarhat
 
PDF
learning react
Eueung Mulyana
 
PPTX
React JS part 1
Diluka Wittahachchige
 
DOCX
Skill practical javascript diy projects
SkillPracticalEdTech
 
PPTX
React - Start learning today
Nitin Tyagi
 
PDF
From MVC to React
Eric Clemmons
 
PDF
Review on React JS
ijtsrd
 
PDF
Why React is the Future of Front-End Development
Elightwalk Technology PVT. LTD.
 
PDF
Why React is the Future of Front-End Development.pdf
Elightwalk Technology PVT. LTD.
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PPTX
MVC & backbone.js
Mohammed Arif
 
PDF
Maximize Development Efficiency with ReactJS.pdf
BOSC Tech Labs
 
PPTX
React intro
PushkarThakur7
 
PPTX
React workshop presentation
Bojan Golubović
 
PDF
reactjs interview questions.pdf
rohityadav23214
 
PDF
Front End Development for Back End Java Developers - NYJavaSIG 2019
Matt Raible
 
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
The Best Guide to Know What, Why, When to Use Is ReactJS
WeblineIndia
 
Master React in 20 Days !.pdf used for react
shameer200479
 
React js vs react native a comparative analysis
Shelly Megan
 
React Interview Question PDF By ScholarHat
Scholarhat
 
learning react
Eueung Mulyana
 
React JS part 1
Diluka Wittahachchige
 
Skill practical javascript diy projects
SkillPracticalEdTech
 
React - Start learning today
Nitin Tyagi
 
From MVC to React
Eric Clemmons
 
Review on React JS
ijtsrd
 
Why React is the Future of Front-End Development
Elightwalk Technology PVT. LTD.
 
Why React is the Future of Front-End Development.pdf
Elightwalk Technology PVT. LTD.
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
MVC & backbone.js
Mohammed Arif
 
Maximize Development Efficiency with ReactJS.pdf
BOSC Tech Labs
 
React intro
PushkarThakur7
 
React workshop presentation
Bojan Golubović
 
reactjs interview questions.pdf
rohityadav23214
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Matt Raible
 
Ad

Recently uploaded (20)

PPTX
原版北不列颠哥伦比亚大学毕业证文凭UNBC成绩单2025年新版在线制作学位证书
e7nw4o4
 
PPT
1965 INDO PAK WAR which Pak will never forget.ppt
sanjaychief112
 
PPTX
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
DOCX
An_Operating_System by chidi kingsley wo
kingsleywokocha4
 
PPTX
The Monk and the Sadhurr and the story of how
BeshoyGirgis2
 
PDF
UI/UX Developer Guide: Tools, Trends, and Tips for 2025
Penguin peak
 
PPTX
Birth-after-Previous-Caesarean-Birth (1).pptx
fermann1
 
PDF
The AI Trust Gap: Consumer Attitudes to AI-Generated Content
Exploding Topics
 
PDF
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
PPTX
Finally, My Best IPTV Provider That Understands Movie Lovers Experience IPTVG...
Rafael IPTV
 
PPTX
MSadfadsfafdadfccadradfT_Presentation.pptx
pahalaedward2
 
PPTX
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
PPTX
Slides pptx: World Game's Eco Economic Epochs.pptx
Steven McGee
 
PPT
Introduction to dns domain name syst.ppt
MUHAMMADKAVISHSHABAN
 
PPTX
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
PPTX
AI at Your Side: Boost Impact Without Losing the Human Touch (SXSW 2026 Meet ...
maytaldahan
 
PPTX
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
PDF
Paper PDF: World Game (s) Great Redesign.pdf
Steven McGee
 
PDF
GEO Strategy 2025: Complete Presentation Deck for AI-Powered Customer Acquisi...
Zam Man
 
PPTX
How tech helps people in the modern era.
upadhyayaryan154
 
原版北不列颠哥伦比亚大学毕业证文凭UNBC成绩单2025年新版在线制作学位证书
e7nw4o4
 
1965 INDO PAK WAR which Pak will never forget.ppt
sanjaychief112
 
Artificial-Intelligence-in-Daily-Life (2).pptx
nidhigoswami335
 
An_Operating_System by chidi kingsley wo
kingsleywokocha4
 
The Monk and the Sadhurr and the story of how
BeshoyGirgis2
 
UI/UX Developer Guide: Tools, Trends, and Tips for 2025
Penguin peak
 
Birth-after-Previous-Caesarean-Birth (1).pptx
fermann1
 
The AI Trust Gap: Consumer Attitudes to AI-Generated Content
Exploding Topics
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
Finally, My Best IPTV Provider That Understands Movie Lovers Experience IPTVG...
Rafael IPTV
 
MSadfadsfafdadfccadradfT_Presentation.pptx
pahalaedward2
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
Slides pptx: World Game's Eco Economic Epochs.pptx
Steven McGee
 
Introduction to dns domain name syst.ppt
MUHAMMADKAVISHSHABAN
 
Perkembangan Perangkat jaringan komputer dan telekomunikasi 3.pptx
Prayudha3
 
AI at Your Side: Boost Impact Without Losing the Human Touch (SXSW 2026 Meet ...
maytaldahan
 
The Internet of Things (IoT) refers to a vast network of interconnected devic...
chethana8182
 
Paper PDF: World Game (s) Great Redesign.pdf
Steven McGee
 
GEO Strategy 2025: Complete Presentation Deck for AI-Powered Customer Acquisi...
Zam Man
 
How tech helps people in the modern era.
upadhyayaryan154
 

Introduction to react js

Editor's Notes

  • #3: * Simple Simply express how your app should look at any given point in time, and React will automatically manage all UI updates when your underlying data changes. * Declarative When the data changes, React conceptually hits the "refresh" button, and knows to only update the changed parts.
  • #5: Use diagram example to highlight issues of code-reuse and app-maintence with app-functionality fragmented throughout the codebase.
  • #6: Basically these template engines compile into HTML which renders on the user’s browser. But it allows developers to re-use code and inject dynamic content into otherwise dull static web pages. Ask the audience what they think the dust-partial does (example of how cryptic each engine can be)
  • #7: Explain and run the audience thru the 2 components and how they’re combined into one view which is rendered into a div-element by the reactJS engine.
  • #13: Explain the example. The way React compares the DOMs, notes diff changes and re-renders only the delta part of the DOM. This partial update is much faster than a full DOM update.
  • #18: Before we can proceed to add validation logic into our component we’ll need to understand another React concept: State Almost all applications maintain some form of state (e.g: User clicker ‘Like’ on a social-media site which increments a counter)