SlideShare a Scribd company logo
ReactJS basics
An enticing introduction
We will talk about
 What is React?
 Why do people use React?
 Pre-requisites to learning React
 A tour of React eco-system
 React “Hello World” in 3 mins
 Some basic concepts
 The path forward
What is React?
 A declarative, efficient, and flexible JavaScript library for building user interfaces
 Designed for gradual adoption, and you can use as little or as much React as you
need
People use it for a presentation library
https://github.com/FormidableLabs/spectacle
Virtual Reality
ReactVR rotating boxes
To build a shopping cart
https://github.com/jeffersonRibeiro/react-shopping-cart
Online editors
https://codesandbox.io/s/
Create physics based animation library
https://github.com/react-spring/react-spring
Create word documents
https://github.com/nitin42/redocx
Mobile apps and games of course
And many more cool things…
Why do people use
React?
 Awesome documentation & support
 That has led to a wonderful ecosystem
 Great dev tools
 Efficient DOM management
Source: https://codesandbox.io/search?refinementList%5Btemplate%5D=&page=1
More numbers…
Don’t believe me on this though…
https://2018.stateofjs.com/front-end-frameworks/overview/
But, how is the ReactJS market in India?
Ok, but how is it in Ahmedabad?
Prerequisites
Basic would suffice
Advanced would help grab faster
React eco-system
React ecosystem
Lets understand through a discussion between two friends.
Anil asks for suggestions from his friend Biju on technology he should use for fetching
API data and displaying it on his web app.
An animated version of blog How it feels to learn javascript in 2016
I was thinking
maybe using
jQuery to fetch
and display the
data?
Oh my god no,
no one uses
jQuery anymore.
You should try
learning React,
it’s 2016
Oh, OK. What’s
React?
A super cool
library made by
some guys at
Facebook, it
brings control &
performance to
your application,
by allowing you to
handle any view
changes very
easily
That sounds neat.
Can I use React to
display data from
the server?
Yeah, but first
you need to add
React and React
DOM as a
library in your
webpage. Why two
libraries?
So one is the
actual library and
the second one is
for manipulating
the DOM, which
now you can
describe in JSX.
JSX? What is JSX?
JSX is just a
JavaScript syntax
extension that
looks pretty much
like XML. It’s kind
of another way to
describe the DOM,
think of it as a
better HTML.
If I add these two
libraries then I can
use React?
Not quite. You
need to add
Babel, and then
you are able to
use React.
Another library?
What’s Babel?
Babel is a
transpiler that
allows you to
target specific
versions of
JavaScript, while
you code in any
version of
JavaScript. Babel
allows you to
code in
ES2016+ rather
than ES5
ES5, ES2016+? I’m
getting lost over
here.
ES5 stands for
ECMAScript 5. It’s
the edition that
has most people
target since it has
been
implemented by
most browsers
nowadays.
ECMAScript?
Its the scripting
standard
JavaScript was
based on in 1999
after its initial
release in 1995.
We have, like, 7
editions of this
implementation.
7 editions. For
real. And ES5 and
ES2016+ are?
The fifth and
seventh edition
respectively.
Wait, what
happened with
the sixth?
Each edition is a
superset of the
previous one, so
if you are using
ES2016+, you
are using all the
features of the
previous
versions.
And why use
ES2016+ over ES6
then?
You could use ES6,
but to use cool
features like async
and await, you need
to use ES2016+.
Otherwise you are
stuck with ES6
generators with
coroutines to block
asynchronous calls
for proper control
flow.
All these names
are confusing.
Look, I’m just
loading a bunch
of data from a
server, I used to
be able to just
include jQuery
from a CDN and
just get the data
with AJAX calls,
why can’t I just do
that?
It’s 2016 man,
no one uses
jQuery anymore,
it ends up in a
bunch of
spaghetti code.
Everyone knows
that.
Right. So my
alternative is to
load three libraries
to fetch data and
display a HTML
table.
Well, you
include those
three libraries
but bundle
them up with a
module
manager to load
only one file.
And what’s a
module manager?
The definition
depends on the
environment, but in
the web we usually
mean anything that
supports AMD or
CommonJS modules
And AMD and
CommonJS are…
Ways to describe
how multiple
JavaScript libraries
should interact. You
know, import and
requires? You can
write multiple
JavaScript files using
AMD or CommonJS
API & you can use
something like
Browserify to
bundle them up
OK, that makes
sense… What is
Browserify?
A tool that allows
you to bundle
dependencies to files
that can be run in
the browser. It was
created because
most people publish
those dependencies
in the npm registry.
So I need to
download the
libraries from npm
then?
Yes. so if you
want to use
React , you
download the
React module
and import it in
your code. You
can do that for
almost every
popular
JavaScript
library.
Oh, like Angular!
Angular is so 2015.
But yes. Angular
would be there,
alongside VueJS or
RxJS and other cool
2016 libraries. Want
to learn about
those?
npm registry?
It’s a very big
public repository
where smart
people put code
and dependencies
as modules
Is the learning curve so steep?
 https://github.com/kamranahmedse/developer-roadmap
Do not feel so overwhelming. Not yet.
https://www.youtube.com/watch?v=mbiryVTIJ4Q
React “Hello World” in 3 minutes
Some basic concepts
 React components – Describe how a section of UI will appear based on the props
passed. Eg: Label, ShoppingCard, CreateUser
- Component is just a function/class. props are arguments.
 Class in javascript are actually Functions
 And Functions in javascript are actually Objects
- And so Class & Functions both can be stateful
Sample ReactJS component tree
Some basic concepts
Function to add 2 nos
add(2, 5)
What if I want total of 3 & 7
add(3,7)
React button component
<Button>Submit</Button>
What if I want to display a spinner on click?
<Button spinner=true>Submit</Button>
The path forward
 JSX semantics
 Stateful & Stateless components
 State & how to change it
 React advanced patterns
 React life cycle
 Context & Ref
 React Hooks
 Using developer tools
 Redux (External library for state management)
 React Router
And learning never stops…

More Related Content

PPTX
React workshop
Imran Sayed
 
PPTX
Introduction to react_js
MicroPyramid .
 
PDF
React JS - Introduction
Sergey Romaneko
 
PPTX
React js for beginners
Alessandro Valenti
 
PDF
React JS and why it's awesome
Andrew Hull
 
PPTX
React-JS.pptx
AnmolPandita7
 
PPTX
React js - The Core Concepts
Divyang Bhambhani
 
PDF
Redux Toolkit - Quick Intro - 2022
Fabio Biondi
 
React workshop
Imran Sayed
 
Introduction to react_js
MicroPyramid .
 
React JS - Introduction
Sergey Romaneko
 
React js for beginners
Alessandro Valenti
 
React JS and why it's awesome
Andrew Hull
 
React-JS.pptx
AnmolPandita7
 
React js - The Core Concepts
Divyang Bhambhani
 
Redux Toolkit - Quick Intro - 2022
Fabio Biondi
 

What's hot (20)

ODP
Introduction to ReactJS
Knoldus Inc.
 
PPTX
Its time to React.js
Ritesh Mehrotra
 
PPTX
ReactJs
Sahana Banerjee
 
PDF
Workshop 21: React Router
Visual Engineering
 
PPTX
React JS: A Secret Preview
valuebound
 
PPTX
React hooks
Ramy ElBasyouni
 
PPTX
Reactjs
Neha Sharma
 
PDF
An Introduction to ReactJS
All Things Open
 
PPTX
Introduction to React
Rob Quick
 
PPTX
React js programming concept
Tariqul islam
 
PPTX
React workshop presentation
Bojan Golubović
 
PPTX
React + Redux Introduction
Nikolaus Graf
 
PDF
ReactJS presentation
Thanh Tuong
 
PDF
Introduction to Redux
Ignacio Martín
 
PDF
An introduction to React.js
Emanuele DelBono
 
PPTX
React Hooks
Joao Marins
 
PDF
introduction to Vue.js 3
ArezooKmn
 
PPTX
React js
Nikhil Karkra
 
PPTX
reactJS
Syam Santhosh
 
PDF
Introduction to ReactJS
Hoang Long
 
Introduction to ReactJS
Knoldus Inc.
 
Its time to React.js
Ritesh Mehrotra
 
Workshop 21: React Router
Visual Engineering
 
React JS: A Secret Preview
valuebound
 
React hooks
Ramy ElBasyouni
 
Reactjs
Neha Sharma
 
An Introduction to ReactJS
All Things Open
 
Introduction to React
Rob Quick
 
React js programming concept
Tariqul islam
 
React workshop presentation
Bojan Golubović
 
React + Redux Introduction
Nikolaus Graf
 
ReactJS presentation
Thanh Tuong
 
Introduction to Redux
Ignacio Martín
 
An introduction to React.js
Emanuele DelBono
 
React Hooks
Joao Marins
 
introduction to Vue.js 3
ArezooKmn
 
React js
Nikhil Karkra
 
reactJS
Syam Santhosh
 
Introduction to ReactJS
Hoang Long
 

Similar to React js basics (20)

PPTX
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
PDF
Reactjs Basics
Hamid Ghorbani
 
PPTX
React_Complete.pptx
kamalakantas
 
PPTX
001. Introduction about React
Binh Quan Duc
 
DOCX
Skill practical javascript diy projects
SkillPracticalEdTech
 
PPTX
React JS part 1
Diluka Wittahachchige
 
PDF
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
bandmvh3697
 
PDF
Review on React JS
ijtsrd
 
PDF
React in Action ( PDFDrive ).pdf
almako2
 
PDF
Intro to react_v2
Feather Knee
 
PPTX
Comprehensive Guide to React Development 2022.pptx
75waytechnologies
 
PPTX
React october2017
David Greenfield
 
PDF
Lezione 03 Introduzione a react
University of Catania
 
PDF
Learn react by Etietop Demas
Etietop Demas
 
PDF
Getting Started with React, When You’re an Angular Developer
Fabrit Global
 
PDF
How Can the Hermes Engine Help React Native Apps.docx.pdf
Techugo
 
PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
PDF
How Can the Hermes Engine Help React Native Apps.
Techugo
 
PPTX
From JSX to Deployment: Mastering the React Workflow for Scalable Front-End D...
sriniravir05
 
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
Reactjs Basics
Hamid Ghorbani
 
React_Complete.pptx
kamalakantas
 
001. Introduction about React
Binh Quan Duc
 
Skill practical javascript diy projects
SkillPracticalEdTech
 
React JS part 1
Diluka Wittahachchige
 
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
bandmvh3697
 
Review on React JS
ijtsrd
 
React in Action ( PDFDrive ).pdf
almako2
 
Intro to react_v2
Feather Knee
 
Comprehensive Guide to React Development 2022.pptx
75waytechnologies
 
React october2017
David Greenfield
 
Lezione 03 Introduzione a react
University of Catania
 
Learn react by Etietop Demas
Etietop Demas
 
Getting Started with React, When You’re an Angular Developer
Fabrit Global
 
How Can the Hermes Engine Help React Native Apps.docx.pdf
Techugo
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
How Can the Hermes Engine Help React Native Apps.
Techugo
 
From JSX to Deployment: Mastering the React Workflow for Scalable Front-End D...
sriniravir05
 

Recently uploaded (20)

PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PPTX
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
PDF
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
This slide provides an overview Technology
mineshkharadi333
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PPTX
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PPTX
Coupa-Overview _Assumptions presentation
annapureddyn
 
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Best ERP System for Manufacturing in India | Elite Mindz
Elite Mindz
 
Doc9.....................................
SofiaCollazos
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Stamford - Community User Group Leaders_ Agentblazer Status, AI Sustainabilit...
Amol Dixit
 
The Evolution of KM Roles (Presented at Knowledge Summit Dublin 2025)
Enterprise Knowledge
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
This slide provides an overview Technology
mineshkharadi333
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Building High-Performance Oracle Teams: Strategic Staffing for Database Manag...
SMACT Works
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Smart Infrastructure and Automation through IoT Sensors
Rejig Digital
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
Coupa-Overview _Assumptions presentation
annapureddyn
 
Revolutionize Operations with Intelligent IoT Monitoring and Control
Rejig Digital
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 

React js basics

  • 2. We will talk about  What is React?  Why do people use React?  Pre-requisites to learning React  A tour of React eco-system  React “Hello World” in 3 mins  Some basic concepts  The path forward
  • 3. What is React?  A declarative, efficient, and flexible JavaScript library for building user interfaces  Designed for gradual adoption, and you can use as little or as much React as you need
  • 4. People use it for a presentation library https://github.com/FormidableLabs/spectacle
  • 6. To build a shopping cart https://github.com/jeffersonRibeiro/react-shopping-cart
  • 8. Create physics based animation library https://github.com/react-spring/react-spring
  • 10. Mobile apps and games of course
  • 11. And many more cool things…
  • 12. Why do people use React?  Awesome documentation & support  That has led to a wonderful ecosystem  Great dev tools  Efficient DOM management Source: https://codesandbox.io/search?refinementList%5Btemplate%5D=&page=1
  • 14. Don’t believe me on this though… https://2018.stateofjs.com/front-end-frameworks/overview/
  • 15. But, how is the ReactJS market in India?
  • 16. Ok, but how is it in Ahmedabad?
  • 19. React ecosystem Lets understand through a discussion between two friends. Anil asks for suggestions from his friend Biju on technology he should use for fetching API data and displaying it on his web app. An animated version of blog How it feels to learn javascript in 2016
  • 20. I was thinking maybe using jQuery to fetch and display the data? Oh my god no, no one uses jQuery anymore. You should try learning React, it’s 2016 Oh, OK. What’s React? A super cool library made by some guys at Facebook, it brings control & performance to your application, by allowing you to handle any view changes very easily That sounds neat. Can I use React to display data from the server? Yeah, but first you need to add React and React DOM as a library in your webpage. Why two libraries? So one is the actual library and the second one is for manipulating the DOM, which now you can describe in JSX.
  • 21. JSX? What is JSX? JSX is just a JavaScript syntax extension that looks pretty much like XML. It’s kind of another way to describe the DOM, think of it as a better HTML. If I add these two libraries then I can use React? Not quite. You need to add Babel, and then you are able to use React. Another library? What’s Babel? Babel is a transpiler that allows you to target specific versions of JavaScript, while you code in any version of JavaScript. Babel allows you to code in ES2016+ rather than ES5 ES5, ES2016+? I’m getting lost over here. ES5 stands for ECMAScript 5. It’s the edition that has most people target since it has been implemented by most browsers nowadays.
  • 22. ECMAScript? Its the scripting standard JavaScript was based on in 1999 after its initial release in 1995. We have, like, 7 editions of this implementation. 7 editions. For real. And ES5 and ES2016+ are? The fifth and seventh edition respectively. Wait, what happened with the sixth? Each edition is a superset of the previous one, so if you are using ES2016+, you are using all the features of the previous versions. And why use ES2016+ over ES6 then? You could use ES6, but to use cool features like async and await, you need to use ES2016+. Otherwise you are stuck with ES6 generators with coroutines to block asynchronous calls for proper control flow.
  • 23. All these names are confusing. Look, I’m just loading a bunch of data from a server, I used to be able to just include jQuery from a CDN and just get the data with AJAX calls, why can’t I just do that? It’s 2016 man, no one uses jQuery anymore, it ends up in a bunch of spaghetti code. Everyone knows that.
  • 24. Right. So my alternative is to load three libraries to fetch data and display a HTML table. Well, you include those three libraries but bundle them up with a module manager to load only one file. And what’s a module manager? The definition depends on the environment, but in the web we usually mean anything that supports AMD or CommonJS modules And AMD and CommonJS are… Ways to describe how multiple JavaScript libraries should interact. You know, import and requires? You can write multiple JavaScript files using AMD or CommonJS API & you can use something like Browserify to bundle them up OK, that makes sense… What is Browserify? A tool that allows you to bundle dependencies to files that can be run in the browser. It was created because most people publish those dependencies in the npm registry.
  • 25. So I need to download the libraries from npm then? Yes. so if you want to use React , you download the React module and import it in your code. You can do that for almost every popular JavaScript library. Oh, like Angular! Angular is so 2015. But yes. Angular would be there, alongside VueJS or RxJS and other cool 2016 libraries. Want to learn about those? npm registry? It’s a very big public repository where smart people put code and dependencies as modules
  • 26. Is the learning curve so steep?  https://github.com/kamranahmedse/developer-roadmap
  • 27. Do not feel so overwhelming. Not yet. https://www.youtube.com/watch?v=mbiryVTIJ4Q
  • 28. React “Hello World” in 3 minutes
  • 29. Some basic concepts  React components – Describe how a section of UI will appear based on the props passed. Eg: Label, ShoppingCard, CreateUser - Component is just a function/class. props are arguments.  Class in javascript are actually Functions  And Functions in javascript are actually Objects - And so Class & Functions both can be stateful
  • 31. Some basic concepts Function to add 2 nos add(2, 5) What if I want total of 3 & 7 add(3,7) React button component <Button>Submit</Button> What if I want to display a spinner on click? <Button spinner=true>Submit</Button>
  • 32. The path forward  JSX semantics  Stateful & Stateless components  State & how to change it  React advanced patterns  React life cycle  Context & Ref  React Hooks  Using developer tools  Redux (External library for state management)  React Router And learning never stops…