SlideShare a Scribd company logo
1 of 18
Introduction to React
Before starting React?
What is DOM?
DOM is the Document Object Model
Dom works as a model in
front of artist i.e. Web
browser
What is React ?
• A library for creating user interfaces
V in MVC Model
• React is a middle man between
DOM and Developer
• Smooths the process and
communication of portrait creation
Three main tricks
• Reactive UI
• Virtual DOM
• Components
Reactive UI
• When you update with jQuery
you have to tell DOM everything
where to go and what to update.
• Heck, this sounds tedious and
error-prone! Why can’t you just
tell Dom what you want instead
of how to pose?
Reactive UI
• As a dev you say what you want.
React figures out how to do it.
• Data change UI updates itself
automatically.
• The idea of reactive UI greatly
simplifies UI development.
Virtual DOM
As a dev you want quick update
but Dom and artist (browser)
make dev wait to give more
orders.
Virtual DOM
• React make sketches for the dev updates and then updates the
real Dom.
• React keeps record of everything with sketches and show it to
Dom at the right time.
• React is smart. He can sort through the sketches, remove any
duplication and make sure that Dom and the artist do as little
work as possible.
Virtual DOM
Components
• Blocks of pieces that joins
together to build a big thing.
• Our cars, houses and even our
bodies are all made up of
identifiable components that are
individual, functional units.
Components
If you change a component,
everything that includes this
component will be updated
automatically.
Props v/s State
• Props are Read Only
• Props is what you received
(Immutable) from parent
component
• State change can be
asynchronous
• State is what you own (Mutable)
Let us consider following
components
• Roof
• Wall
• Door
• Window
Props
• For <Roof color="blue" /> roof is blue
• For <Roof color="red" /> roof would be red.
• Main idea Components are reusable. I make a
skeleton roof once can use it multiple times with
different properties.
<Roof color="blue" material="wood" />
Now the house is built.
What if we want to change the things now?
• For example we want to open or
close the door.
• For that we have state.
• Door state is handle within door
component. Its only doors
business.
Life Cycles
Life Cycles
Thank you
Any Questions?

More Related Content

What's hot

What's hot (20)

Making ember-wormhole work with Fastboot
Making ember-wormhole work with FastbootMaking ember-wormhole work with Fastboot
Making ember-wormhole work with Fastboot
 
Jekyll Presentation Slides
Jekyll Presentation SlidesJekyll Presentation Slides
Jekyll Presentation Slides
 
Jekyll, static websites generator
Jekyll, static websites generatorJekyll, static websites generator
Jekyll, static websites generator
 
Introduction to blogging with Jekyll
Introduction to blogging with JekyllIntroduction to blogging with Jekyll
Introduction to blogging with Jekyll
 
Next generation testing
Next generation testingNext generation testing
Next generation testing
 
The WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website GreatnessThe WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website Greatness
 
Bringing better user experience to Joomla with Page Builders
Bringing better user experience to Joomla with Page BuildersBringing better user experience to Joomla with Page Builders
Bringing better user experience to Joomla with Page Builders
 
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
Should I Build a Separate Mobile Site or a Responsive Site? Neither! with Der...
 
Mobile Website or Responsive Design? The Answer is NEITHER.
Mobile Website or Responsive Design? The Answer is NEITHER.Mobile Website or Responsive Design? The Answer is NEITHER.
Mobile Website or Responsive Design? The Answer is NEITHER.
 
Optimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday TrafficOptimizing Your Site for Holiday Traffic
Optimizing Your Site for Holiday Traffic
 
Blogging With Jekyll | Blogging Like a Hacker
Blogging With Jekyll | Blogging Like a HackerBlogging With Jekyll | Blogging Like a Hacker
Blogging With Jekyll | Blogging Like a Hacker
 
Going Multi-Tenant with dotCMS
Going Multi-Tenant with dotCMSGoing Multi-Tenant with dotCMS
Going Multi-Tenant with dotCMS
 
Automated perf optimization - jQuery Conference
Automated perf optimization - jQuery ConferenceAutomated perf optimization - jQuery Conference
Automated perf optimization - jQuery Conference
 
Dynamic web
Dynamic webDynamic web
Dynamic web
 
Webinar: Gettin' Down and Nerdy with the Genesis Framework
Webinar: Gettin' Down and Nerdy with the Genesis FrameworkWebinar: Gettin' Down and Nerdy with the Genesis Framework
Webinar: Gettin' Down and Nerdy with the Genesis Framework
 
Railsconf 2014 - Deploying Rails is Easier Thank It Looks
Railsconf 2014 - Deploying Rails is Easier Thank It LooksRailsconf 2014 - Deploying Rails is Easier Thank It Looks
Railsconf 2014 - Deploying Rails is Easier Thank It Looks
 
TallyJS #1 - Intro to AngularJS
TallyJS #1 - Intro to AngularJSTallyJS #1 - Intro to AngularJS
TallyJS #1 - Intro to AngularJS
 
Webinar - Accessibility: The journey.
Webinar - Accessibility: The journey.Webinar - Accessibility: The journey.
Webinar - Accessibility: The journey.
 
Angular - a real world case study
Angular - a real world case studyAngular - a real world case study
Angular - a real world case study
 
Building a dynamic SPA website with Angular
Building a dynamic SPA website with AngularBuilding a dynamic SPA website with Angular
Building a dynamic SPA website with Angular
 

Similar to Introduction to-react

React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
Marcin Grzywaczewski
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theory
jobinThomas54
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
SHAIKIRFAN715544
 

Similar to Introduction to-react (20)

What is virtual dom in react js
What is virtual dom in react jsWhat is virtual dom in react js
What is virtual dom in react js
 
Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016Web Development with Delphi and React - ITDevCon 2016
Web Development with Delphi and React - ITDevCon 2016
 
ReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOMReactJS - Re-rendering pages in the age of the mutable DOM
ReactJS - Re-rendering pages in the age of the mutable DOM
 
React.js at Cortex
React.js at CortexReact.js at Cortex
React.js at Cortex
 
React.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UIReact.js - and how it changed our thinking about UI
React.js - and how it changed our thinking about UI
 
React Tech Salon
React Tech SalonReact Tech Salon
React Tech Salon
 
Virtual Dom|Browser DOM What are these in React Js?
Virtual Dom|Browser DOM What are these in React Js? Virtual Dom|Browser DOM What are these in React Js?
Virtual Dom|Browser DOM What are these in React Js?
 
Web Components
Web ComponentsWeb Components
Web Components
 
Reactjs workshop (1)
Reactjs workshop (1)Reactjs workshop (1)
Reactjs workshop (1)
 
React js Rahil Memon
React js Rahil MemonReact js Rahil Memon
React js Rahil Memon
 
Angular Ivy- An Overview
Angular Ivy- An OverviewAngular Ivy- An Overview
Angular Ivy- An Overview
 
Designing True Cross-Platform Apps
Designing True Cross-Platform AppsDesigning True Cross-Platform Apps
Designing True Cross-Platform Apps
 
Reactjs workshop
Reactjs workshop Reactjs workshop
Reactjs workshop
 
Features, Exportables & You
Features, Exportables & YouFeatures, Exportables & You
Features, Exportables & You
 
Reactjs notes.pptx for web development- tutorial and theory
Reactjs  notes.pptx for web development- tutorial and theoryReactjs  notes.pptx for web development- tutorial and theory
Reactjs notes.pptx for web development- tutorial and theory
 
Introduction to React JS.pptx
Introduction to React JS.pptxIntroduction to React JS.pptx
Introduction to React JS.pptx
 
React js
React jsReact js
React js
 
Introduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptxIntroduction to ReactJS UI Web Dev .pptx
Introduction to ReactJS UI Web Dev .pptx
 
Getting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular DeveloperGetting Started with React, When You’re an Angular Developer
Getting Started with React, When You’re an Angular Developer
 
Docs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyondDocs at Weaveworks: DX from open source to SaaS and beyond
Docs at Weaveworks: DX from open source to SaaS and beyond
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

Introduction to-react

  • 2. Before starting React? What is DOM? DOM is the Document Object Model Dom works as a model in front of artist i.e. Web browser
  • 3. What is React ? • A library for creating user interfaces V in MVC Model • React is a middle man between DOM and Developer • Smooths the process and communication of portrait creation
  • 4. Three main tricks • Reactive UI • Virtual DOM • Components
  • 5. Reactive UI • When you update with jQuery you have to tell DOM everything where to go and what to update. • Heck, this sounds tedious and error-prone! Why can’t you just tell Dom what you want instead of how to pose?
  • 6. Reactive UI • As a dev you say what you want. React figures out how to do it. • Data change UI updates itself automatically. • The idea of reactive UI greatly simplifies UI development.
  • 7. Virtual DOM As a dev you want quick update but Dom and artist (browser) make dev wait to give more orders.
  • 8. Virtual DOM • React make sketches for the dev updates and then updates the real Dom. • React keeps record of everything with sketches and show it to Dom at the right time. • React is smart. He can sort through the sketches, remove any duplication and make sure that Dom and the artist do as little work as possible.
  • 10. Components • Blocks of pieces that joins together to build a big thing. • Our cars, houses and even our bodies are all made up of identifiable components that are individual, functional units.
  • 11. Components If you change a component, everything that includes this component will be updated automatically.
  • 12. Props v/s State • Props are Read Only • Props is what you received (Immutable) from parent component • State change can be asynchronous • State is what you own (Mutable)
  • 13. Let us consider following components • Roof • Wall • Door • Window
  • 14. Props • For <Roof color="blue" /> roof is blue • For <Roof color="red" /> roof would be red. • Main idea Components are reusable. I make a skeleton roof once can use it multiple times with different properties. <Roof color="blue" material="wood" />
  • 15. Now the house is built. What if we want to change the things now? • For example we want to open or close the door. • For that we have state. • Door state is handle within door component. Its only doors business.