SlideShare a Scribd company logo
React Introduction
What is ReactJs ?
“We build react to solve one problem: building large applications with data that changes over time”
Key Ideas
• Components, not templates
• One-way data flow
• Re-render, Don’t Mutate
• Virtual DOM, simple and fast
• JSX
• React Native
Key Ideas
• Components, not templates
• One-way data flow
• Re-render, Don’t Mutate
• Virtual DOM, simple and fast
• JSX
• React Native
Components CartComponent
CartListComponent
CartItemComponent
Key Ideas
• Components, not templates
• One-way data flow
• Re-render, Don’t Mutate
• Virtual DOM, simple and fast
• JSX
• React Native
One-way data flow
Key Ideas
• Components, not templates
• One-way data flow
• Re-render, Don’t Mutate
• Virtual DOM, simple and fast
• JSX
• React Native
Key Ideas
• Components, not templates
• One-way data flow
• Re-render, Don’t Mutate
• Virtual DOM, simple and fast
• JSX
• React Native
Virtual DOM
Virtual DOM
Key Ideas
• Components, not templates
• One-way data flow
• Re-render, Don’t Mutate
• Virtual DOM, simple and fast
• JSX
• React Native
Key Ideas
• Components, not templates
• One-way data flow
• Re-render, Don’t Mutate
• Virtual DOM, simple and fast
• JSX
• React Native
What’s good about it?
• Easy to start with
• JSX makes components easily understandable
• Rendering can be done on the server
• SEO
• ES6 support
What’s not so good about it?
• No Event System (other than vanilla DOM events)
• No AJAX capabilities
• No Data Layer
• No Application Framework
• No Promises
• No standard way on how to implement all these
Should I Use React?
• Yes, but take into consideration about following points:
• React will slow you down tremendously at the start. Understanding how props, state, and component
communication works is not straightforward, and the docs are a maze of information. This will be countered,
in theory, by a grand speed up when your whole team is on board.
• React does not support any browser below IE8, and never will.
• If your application / website doesn't have very much dynamic page updating, you will be implementing a lot of
code for a very small benefit.
• You will reinvent a lot of wheels. React is young, and because there's no canonical way to do events /
component communication, you'll have to build large component libraries from scratch.
• Best Idea would be to use best practices which were followed by other users, e.g. Airbnb style guide:
• https://github.com/airbnb/javascript/tree/master/react
Part-2
App Setup
• npm i react react-dom -S
• create a index.js file
• add this to the file
import React from 'react';
import {render} from 'react-dom';
class App extends React.Component {
render () {
return <p> Hello React!</p>;
}
State Management
• Not long time ago… $.ajax
• And now we are increasing the UI complexity with JavaScript
• To solve this... Facebook Devs designed Flux
Flux
• It’s a pattern (Application Architecture)
• It’s a nice way to make components to talk to each others
• It’s a unidirectional data flow
Action Dispatcher Store View
Action
Flux - Actions
• Where data get into the system
• Person interaction or process interaction
• Action type and data
Action Dispatcher Store View
Action
Flux - Dispatcher
• It’s the central hub that manages all data flow
• It’s essentially a registry of callback into the stores
Action Dispatcher Store View
Action
Flux - Store
• It’s where you add you state and logic
• It’s result in an update to the state of the store, via dispatcher
• It’s broadcast an event saying that their state has changed
• They view may query the new state and update themselves
Action Dispatcher Store View
Action
Flux - View
• It’s where we show your results
• When it receive the event from the store, it use setState() or forceUpdate()
to render
Action Dispatcher Store View
Action
Flux
DEMO
React introduction
React introduction
References
• https://en.wikipedia.org/wiki/React_(JavaScript_library
)
• https://facebook.github.io/react/
• https://facebook.github.io/flux/
• https://facebook.github.io/react/blog
• http://blog.andrewray.me/reactjs-for-stupid-people/
• http://www.slideshare.net/AndrewHull/react-js-and-

More Related Content

What's hot (20)

PDF
Robust web apps with React.js
Max Klymyshyn
 
PPTX
Introduction to react js
Aeshan Wijetunge
 
PDF
Building Modern Web Applications using React and Redux
Maxime Najim
 
PDF
Learning React - I
Mitch Chen
 
PPTX
A Brief Introduction to React.js
Doug Neiner
 
PPT
React js
Jai Santhosh
 
PDF
JOSA TechTalks - Better Web Apps with React and Redux
Jordan Open Source Association
 
PDF
React js
Rajesh Kolla
 
PDF
React JS - Introduction
Sergey Romaneko
 
PPTX
React js - The Core Concepts
Divyang Bhambhani
 
PPTX
reactJS
Syam Santhosh
 
PPTX
React js
Alireza Akbari
 
PPTX
Intro to React
Eric Westfall
 
PPTX
001. Introduction about React
Binh Quan Duc
 
PDF
React.js+Redux Workshops
Marcin Grzywaczewski
 
PPTX
React js
Nikhil Karkra
 
PPTX
Introduction to React JS for beginners | Namespace IT
namespaceit
 
PDF
Getting Started with React-Nathan Smith
TandemSeven
 
PPTX
ReactJs
Sahana Banerjee
 
PDF
React.js in real world apps.
Emanuele DelBono
 
Robust web apps with React.js
Max Klymyshyn
 
Introduction to react js
Aeshan Wijetunge
 
Building Modern Web Applications using React and Redux
Maxime Najim
 
Learning React - I
Mitch Chen
 
A Brief Introduction to React.js
Doug Neiner
 
React js
Jai Santhosh
 
JOSA TechTalks - Better Web Apps with React and Redux
Jordan Open Source Association
 
React js
Rajesh Kolla
 
React JS - Introduction
Sergey Romaneko
 
React js - The Core Concepts
Divyang Bhambhani
 
reactJS
Syam Santhosh
 
React js
Alireza Akbari
 
Intro to React
Eric Westfall
 
001. Introduction about React
Binh Quan Duc
 
React.js+Redux Workshops
Marcin Grzywaczewski
 
React js
Nikhil Karkra
 
Introduction to React JS for beginners | Namespace IT
namespaceit
 
Getting Started with React-Nathan Smith
TandemSeven
 
React.js in real world apps.
Emanuele DelBono
 

Similar to React introduction (20)

PPTX
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
PPTX
React.js at Cortex
Geoff Harcourt
 
PPTX
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
PDF
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
PPTX
Getting started with react &amp; redux
Girish Talekar
 
PDF
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
bandmvh3697
 
PDF
theory-slides-vueh3urh4ur4ur4r44oirj4riu4ri
paridhiagarwal129
 
PDF
React JS and why it's awesome
Andrew Hull
 
PDF
An Intense Overview of the React Ecosystem
Rami Sayar
 
PPTX
ReactJS Code Impact
Raymond McDermott
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PDF
React & Flux Workshop
Christian Lilley
 
PPTX
React + Flux = Joy
John Need
 
PDF
Introduction to React JS
Bethmi Gunasekara
 
PDF
The Road To Redux
Jeffrey Sanchez
 
PDF
React in Action ( PDFDrive ).pdf
almako2
 
PPTX
React ppt
Naresh Thamizharasan
 
PPTX
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
PPTX
Introduction to React
Austin Garrod
 
PPTX
React_Complete.pptx
kamalakantas
 
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
React.js at Cortex
Geoff Harcourt
 
theory-slides-for react for beginners.pptx
sanchezvanessa7896
 
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
Getting started with react &amp; redux
Girish Talekar
 
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
bandmvh3697
 
theory-slides-vueh3urh4ur4ur4r44oirj4riu4ri
paridhiagarwal129
 
React JS and why it's awesome
Andrew Hull
 
An Intense Overview of the React Ecosystem
Rami Sayar
 
ReactJS Code Impact
Raymond McDermott
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
React & Flux Workshop
Christian Lilley
 
React + Flux = Joy
John Need
 
Introduction to React JS
Bethmi Gunasekara
 
The Road To Redux
Jeffrey Sanchez
 
React in Action ( PDFDrive ).pdf
almako2
 
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
Introduction to React
Austin Garrod
 
React_Complete.pptx
kamalakantas
 
Ad

Recently uploaded (20)

PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
PDF
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
PDF
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PPTX
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
DOCX
Import Data Form Excel to Tally Services
Tally xperts
 
PPTX
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
PPTX
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PPTX
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
PDF
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
PDF
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PPTX
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Human Resources Information System (HRIS)
Amity University, Patna
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Java Native Memory Leaks: The Hidden Villain Behind JVM Performance Issues
Tier1 app
 
GetOnCRM Speeds Up Agentforce 3 Deployment for Enterprise AI Wins.pdf
GetOnCRM Solutions
 
Salesforce CRM Services.VALiNTRY360
VALiNTRY360
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Fundamentals_of_Microservices_Architecture.pptx
MuhammadUzair504018
 
Import Data Form Excel to Tally Services
Tally xperts
 
How Apagen Empowered an EPC Company with Engineering ERP Software
SatishKumar2651
 
An Introduction to ZAP by Checkmarx - Official Version
Simon Bennetts
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
A Complete Guide to Salesforce SMS Integrations Build Scalable Messaging With...
360 SMS APP
 
Mobile CMMS Solutions Empowering the Frontline Workforce
CryotosCMMSSoftware
 
Letasoft Sound Booster 1.12.0.538 Crack Download+ Product Key [Latest]
HyperPc soft
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Equipment Management Software BIS Safety UK.pptx
BIS Safety Software
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Ad

React introduction

  • 2. What is ReactJs ? “We build react to solve one problem: building large applications with data that changes over time”
  • 3. Key Ideas • Components, not templates • One-way data flow • Re-render, Don’t Mutate • Virtual DOM, simple and fast • JSX • React Native
  • 4. Key Ideas • Components, not templates • One-way data flow • Re-render, Don’t Mutate • Virtual DOM, simple and fast • JSX • React Native
  • 6. Key Ideas • Components, not templates • One-way data flow • Re-render, Don’t Mutate • Virtual DOM, simple and fast • JSX • React Native
  • 8. Key Ideas • Components, not templates • One-way data flow • Re-render, Don’t Mutate • Virtual DOM, simple and fast • JSX • React Native
  • 9. Key Ideas • Components, not templates • One-way data flow • Re-render, Don’t Mutate • Virtual DOM, simple and fast • JSX • React Native
  • 12. Key Ideas • Components, not templates • One-way data flow • Re-render, Don’t Mutate • Virtual DOM, simple and fast • JSX • React Native
  • 13. Key Ideas • Components, not templates • One-way data flow • Re-render, Don’t Mutate • Virtual DOM, simple and fast • JSX • React Native
  • 14. What’s good about it? • Easy to start with • JSX makes components easily understandable • Rendering can be done on the server • SEO • ES6 support
  • 15. What’s not so good about it? • No Event System (other than vanilla DOM events) • No AJAX capabilities • No Data Layer • No Application Framework • No Promises • No standard way on how to implement all these
  • 16. Should I Use React? • Yes, but take into consideration about following points: • React will slow you down tremendously at the start. Understanding how props, state, and component communication works is not straightforward, and the docs are a maze of information. This will be countered, in theory, by a grand speed up when your whole team is on board. • React does not support any browser below IE8, and never will. • If your application / website doesn't have very much dynamic page updating, you will be implementing a lot of code for a very small benefit. • You will reinvent a lot of wheels. React is young, and because there's no canonical way to do events / component communication, you'll have to build large component libraries from scratch. • Best Idea would be to use best practices which were followed by other users, e.g. Airbnb style guide: • https://github.com/airbnb/javascript/tree/master/react
  • 18. App Setup • npm i react react-dom -S • create a index.js file • add this to the file import React from 'react'; import {render} from 'react-dom'; class App extends React.Component { render () { return <p> Hello React!</p>; }
  • 19. State Management • Not long time ago… $.ajax • And now we are increasing the UI complexity with JavaScript • To solve this... Facebook Devs designed Flux
  • 20. Flux • It’s a pattern (Application Architecture) • It’s a nice way to make components to talk to each others • It’s a unidirectional data flow Action Dispatcher Store View Action
  • 21. Flux - Actions • Where data get into the system • Person interaction or process interaction • Action type and data Action Dispatcher Store View Action
  • 22. Flux - Dispatcher • It’s the central hub that manages all data flow • It’s essentially a registry of callback into the stores Action Dispatcher Store View Action
  • 23. Flux - Store • It’s where you add you state and logic • It’s result in an update to the state of the store, via dispatcher • It’s broadcast an event saying that their state has changed • They view may query the new state and update themselves Action Dispatcher Store View Action
  • 24. Flux - View • It’s where we show your results • When it receive the event from the store, it use setState() or forceUpdate() to render Action Dispatcher Store View Action
  • 28. References • https://en.wikipedia.org/wiki/React_(JavaScript_library ) • https://facebook.github.io/react/ • https://facebook.github.io/flux/ • https://facebook.github.io/react/blog • http://blog.andrewray.me/reactjs-for-stupid-people/ • http://www.slideshare.net/AndrewHull/react-js-and-