SlideShare a Scribd company logo
2
Most read
5
Most read
6
Most read
React JS
A Quick Introduction Tutorial
Mohammed Fazuluddin
Topics
 Overview
 React JS Features
 React JS Architecture
 React + Redux Architecture
 React JS components
 React JS Best Practices
 Pro’s and Con’s
 Useful Links
Overview
 React JS is a front-end library developed by Facebook. It is used for handling
the view layer for web and mobile apps.
 React JS allows us to create reusable UI components.
 It is currently one of the most popular JavaScript libraries and has a strong
foundation and large community behind it.
 React JS is a declarative, efficient, and flexible JavaScript library for building
user interfaces.
 It lets you compose complex UIs from small and isolated pieces of code called
“components”.
 React JS is JavaScript library used for building reusable UI components.
Overview
 React JS is a library for building composable user interfaces.
 React JS encourages the creation of reusable UI components, which present
data that changes over time.
 Lots of people use React as the V in MVC. React abstracts away the DOM from
you, offering a simpler programming model and better performance.
 React JS can also render on the server using Node, and it can power native
apps using React Native.
 React JS implements one-way reactive data flow, which reduces the
boilerplate and is easier to reason about than traditional data binding.
React JS Features
 JSX − JSX is JavaScript syntax extension. It isn't necessary to use JSX in React
development, but it is recommended.
 Components − React is all about components. You need to think of everything
as a component. This will help you maintain the code when working on larger
scale projects.
 Unidirectional data flow and Flux − React implements one-way data flow
which makes it easy to reason about your app. Flux is a pattern that helps
keeping your data unidirectional.
 License − React is licensed under the Facebook Inc. Documentation is
licensed under CC BY 4.0.
React JS Architecture
React + Redux Architecture
React JS components
 State-full or class-based components
 A state-full component has its state and data associated with the state.
 You can pass data inside this type of component via state or props objects.
 State-full components are also harder to support as they persist some data and
may change the global state of the app.
 State-less or function-based components
 State-less components or function-based components and what React Hooks is for
Function-based components are just simple JavaScript functions.
 State-less function-based components have some limitations and essentially must
have one global place to manage state.
React JS components
 Presentational (or high-order) components
 High-Order Component (or HOC) is essentially a design pattern, also known as a
Decorator Pattern.
 In ReactJS, a HOC is a component that wraps another component by adding extra
functionality or extra properties.
 This allows abstraction from some commonly used logic and keeps your code DRY.
 Container components
 Container components, on the other hand, have logic to set state or have functions
to emit events up to a parent component.
 The general rule of the thumb is to keep your component as simple as possible with
a Single Responsibility Principle design principle in mind, which essentially means
your component must do one thing, but do it well.
React JS Best Practices
 When using ReduxJS, split your Reducer code into smaller methods to avoid
huge JSON within your Reducer.
 Use the create-react-app generator to bootstrap your ReactJS app.
 Keep your code DRY. Don’t Repeat Yourself, but keep in mind code duplicate is
NOT always a bad thing.
 Avoid having large classes, methods or components, including Reducers.
 Use more robust managers to manage application state, such as Redux.
 Use event synchronizer, such as Redux-Thunk, for interactions with your back
end API.
 Avoid passing too many attributes or arguments. Limit yourself to five props
that you pass into your component.
React JS Best Practices
 Use React JS defaultProps and React JS propTypes.
 Use linter, break up lines that are too long.
 Keep your own jslint configuration file.
 Always use a dependency manager with a lock file, such as NPM or yarn.
 Test your commonly accessed code, code that is complex and prone to bugs.
 Use ES6 de-structuring for your props.
 Use conditional rendering.
 User `map()` to collect and render collections of components.
 Use JEST to test your React JS code.
Pro’s and Con’s
 Pro’s:
 Updates process is optimized and accelerated.
 JSX makes components/blocks code readable. It displays how components are
plugged or combined with.
 React’s data binding establishes conditions for creation dynamic applications.
 Prompt rendering. Using comprises methods to minimize number of DOM operations
helps to optimize updating process and accelerate it.
 Testable. React’s native tools are offered for testing, debugging code.
 Up to date. Facebook team supports the library. Advice or code samples can be
given by Facebook community.
 Using React+ES6/7, application gets high-tech and is suitable for high load systems.
Pro’s and Con’s
 Con’s:
 Learning curve. Being not full-featured framework it is required in-depth
knowledge for integration user interface free library into MVC framework.
 View-orientedness is one of the cons of React JS. It should be found 'Model' and
'Controller' to resolve 'View' problem.
 Not using isomorphic approach to exploit application leads to search engines
indexing problems.
 Lots of developers dislike JSX Reacts documentation, manuals are difficult for
newcomers’ understanding.
 Reacts large size library.
Useful Links
 React JS Environment setups
 https://www.tutorialspoint.com/reactjs/reactjs_environment_setup.htm
 Sample Examples
 https://reactjs.org/community/examples.html
Thanks
If you feel that it is helpful and worthy to share with others then please like and share the same.
Ad

Recommended

[Final] ReactJS presentation
[Final] ReactJS presentation
洪 鹏发
 
Introduction to React JS
Introduction to React JS
Arnold Asllani
 
Introduction to React JS for beginners | Namespace IT
Introduction to React JS for beginners | Namespace IT
namespaceit
 
React workshop
React workshop
Imran Sayed
 
ReactJS presentation
ReactJS presentation
Thanh Tuong
 
Intro to React
Intro to React
Eric Westfall
 
Introduction to React JS for beginners
Introduction to React JS for beginners
Varun Raj
 
Introduction to react_js
Introduction to react_js
MicroPyramid .
 
React js
React js
Rajesh Kolla
 
Introduction to ReactJS
Introduction to ReactJS
Knoldus Inc.
 
Learn react-js
Learn react-js
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
Intro to React
Intro to React
Justin Reock
 
Reactjs
Reactjs
Neha Sharma
 
WEB DEVELOPMENT USING REACT JS
WEB DEVELOPMENT USING REACT JS
MuthuKumaran Singaravelu
 
An introduction to React.js
An introduction to React.js
Emanuele DelBono
 
Introduction to React
Introduction to React
Rob Quick
 
React js
React js
Oswald Campesato
 
Its time to React.js
Its time to React.js
Ritesh Mehrotra
 
React js programming concept
React js programming concept
Tariqul islam
 
React + Redux Introduction
React + Redux Introduction
Nikolaus Graf
 
Workshop 21: React Router
Workshop 21: React Router
Visual Engineering
 
React JS - Introduction
React JS - Introduction
Sergey Romaneko
 
Introduction to Redux
Introduction to Redux
Ignacio Martín
 
React Js Simplified
React Js Simplified
Sunil Yadav
 
React js - The Core Concepts
React js - The Core Concepts
Divyang Bhambhani
 
React workshop presentation
React workshop presentation
Bojan Golubović
 
React-JS.pptx
React-JS.pptx
AnmolPandita7
 
Introduction to react js
Introduction to react js
Aeshan Wijetunge
 
ReactJS Development_ Everything You Need to Know.pdf
ReactJS Development_ Everything You Need to Know.pdf
globaltechdev
 
The following features are associated with reacting to lifecycle methods.
The following features are associated with reacting to lifecycle methods.
Wikiance
 

More Related Content

What's hot (20)

React js
React js
Rajesh Kolla
 
Introduction to ReactJS
Introduction to ReactJS
Knoldus Inc.
 
Learn react-js
Learn react-js
C...L, NESPRESSO, WAFAASSURANCE, SOFRECOM ORANGE
 
Intro to React
Intro to React
Justin Reock
 
Reactjs
Reactjs
Neha Sharma
 
WEB DEVELOPMENT USING REACT JS
WEB DEVELOPMENT USING REACT JS
MuthuKumaran Singaravelu
 
An introduction to React.js
An introduction to React.js
Emanuele DelBono
 
Introduction to React
Introduction to React
Rob Quick
 
React js
React js
Oswald Campesato
 
Its time to React.js
Its time to React.js
Ritesh Mehrotra
 
React js programming concept
React js programming concept
Tariqul islam
 
React + Redux Introduction
React + Redux Introduction
Nikolaus Graf
 
Workshop 21: React Router
Workshop 21: React Router
Visual Engineering
 
React JS - Introduction
React JS - Introduction
Sergey Romaneko
 
Introduction to Redux
Introduction to Redux
Ignacio Martín
 
React Js Simplified
React Js Simplified
Sunil Yadav
 
React js - The Core Concepts
React js - The Core Concepts
Divyang Bhambhani
 
React workshop presentation
React workshop presentation
Bojan Golubović
 
React-JS.pptx
React-JS.pptx
AnmolPandita7
 
Introduction to react js
Introduction to react js
Aeshan Wijetunge
 

Similar to React JS - A quick introduction tutorial (20)

ReactJS Development_ Everything You Need to Know.pdf
ReactJS Development_ Everything You Need to Know.pdf
globaltechdev
 
The following features are associated with reacting to lifecycle methods.
The following features are associated with reacting to lifecycle methods.
Wikiance
 
reactJS
reactJS
Syam Santhosh
 
React Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHat
Scholarhat
 
React Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdf
BOSC Tech Labs
 
Techpaathshala ReactJS .pdf
Techpaathshala ReactJS .pdf
Techpaathshala
 
FRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
Top 10 Differences Between React and JavaScript: A Detailed Comparison
Top 10 Differences Between React and JavaScript: A Detailed Comparison
Inwizards Software Technology
 
react js training|react js training in mumbai|
react js training|react js training in mumbai|
programmersclubonlin
 
learning react
learning react
Eueung Mulyana
 
React js introduction about it's features
React js introduction about it's features
SaiM947604
 
a-detailed-guide-everything-you-need-to-know-about-reactjs.pdf
a-detailed-guide-everything-you-need-to-know-about-reactjs.pdf
RobertThorson2
 
What is ReactJS?
What is ReactJS?
Albiorix Technology
 
Comprehensive Guide to React Development 2022.pptx
Comprehensive Guide to React Development 2022.pptx
75waytechnologies
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
RobertThorson2
 
React js vs react native a comparative analysis
React js vs react native a comparative analysis
Shelly Megan
 
Reactjs
Reactjs
Mallikarjuna G D
 
Why Use React Js A Complete Guide (1).pdf
Why Use React Js A Complete Guide (1).pdf
Katy Slemon
 
All about React Js
All about React Js
Gargi Raghav
 
ReactJS Development_ Everything You Need to Know.pdf
ReactJS Development_ Everything You Need to Know.pdf
globaltechdev
 
The following features are associated with reacting to lifecycle methods.
The following features are associated with reacting to lifecycle methods.
Wikiance
 
React Interview Question & Answers PDF By ScholarHat
React Interview Question & Answers PDF By ScholarHat
Scholarhat
 
React Best Practices All Developers Should Follow in 2024.pdf
React Best Practices All Developers Should Follow in 2024.pdf
BOSC Tech Labs
 
Techpaathshala ReactJS .pdf
Techpaathshala ReactJS .pdf
Techpaathshala
 
FRONTEND DEVELOPMENT WITH REACT.JS
FRONTEND DEVELOPMENT WITH REACT.JS
IRJET Journal
 
Top 10 Differences Between React and JavaScript: A Detailed Comparison
Top 10 Differences Between React and JavaScript: A Detailed Comparison
Inwizards Software Technology
 
react js training|react js training in mumbai|
react js training|react js training in mumbai|
programmersclubonlin
 
React js introduction about it's features
React js introduction about it's features
SaiM947604
 
a-detailed-guide-everything-you-need-to-know-about-reactjs.pdf
a-detailed-guide-everything-you-need-to-know-about-reactjs.pdf
RobertThorson2
 
Comprehensive Guide to React Development 2022.pptx
Comprehensive Guide to React Development 2022.pptx
75waytechnologies
 
React Interview Question PDF By ScholarHat
React Interview Question PDF By ScholarHat
Scholarhat
 
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
RobertThorson2
 
React js vs react native a comparative analysis
React js vs react native a comparative analysis
Shelly Megan
 
Why Use React Js A Complete Guide (1).pdf
Why Use React Js A Complete Guide (1).pdf
Katy Slemon
 
All about React Js
All about React Js
Gargi Raghav
 
Ad

More from Mohammed Fazuluddin (20)

Cloud Providers and Their Key Features Explained
Cloud Providers and Their Key Features Explained
Mohammed Fazuluddin
 
Database Performance Handling : A comprehensive guide
Database Performance Handling : A comprehensive guide
Mohammed Fazuluddin
 
Design patterns Q&A | Important question and answers
Design patterns Q&A | Important question and answers
Mohammed Fazuluddin
 
Software-Requirements-to-System-Design Basics
Software-Requirements-to-System-Design Basics
Mohammed Fazuluddin
 
MEAN-vs-MERN-A-Developers-Guide and Explanation
MEAN-vs-MERN-A-Developers-Guide and Explanation
Mohammed Fazuluddin
 
Cloud AI Deployment Design Patterns - Learn the Basic Deployment Patterns
Cloud AI Deployment Design Patterns - Learn the Basic Deployment Patterns
Mohammed Fazuluddin
 
Auto-scaling-real-time-software-applications-and-best-practices.pdf
Auto-scaling-real-time-software-applications-and-best-practices.pdf
Mohammed Fazuluddin
 
Java Version(v5 -v23) Features with sample code snippet
Java Version(v5 -v23) Features with sample code snippet
Mohammed Fazuluddin
 
Cloud Architecture Framework Pillar’s.pdf
Cloud Architecture Framework Pillar’s.pdf
Mohammed Fazuluddin
 
Implementing Generative AI and Machine Learning on GCP: Architectures, Use Ca...
Implementing Generative AI and Machine Learning on GCP: Architectures, Use Ca...
Mohammed Fazuluddin
 
LEVERAGING AWS GENERATIVE AI: ARCHITECTURAL INSIGHTS AND REAL-WORLD IMPLEMENT...
LEVERAGING AWS GENERATIVE AI: ARCHITECTURAL INSIGHTS AND REAL-WORLD IMPLEMENT...
Mohammed Fazuluddin
 
Basics of GraphQL : Unlocking the Power of GraphQL
Basics of GraphQL : Unlocking the Power of GraphQL
Mohammed Fazuluddin
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
Mohammed Fazuluddin
 
DOMAIN DRIVER DESIGN
DOMAIN DRIVER DESIGN
Mohammed Fazuluddin
 
New Relic Basics
New Relic Basics
Mohammed Fazuluddin
 
Terraform Basics
Terraform Basics
Mohammed Fazuluddin
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
Mohammed Fazuluddin
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
Mohammed Fazuluddin
 
Mule ESB - An Enterprise Service Bus
Mule ESB - An Enterprise Service Bus
Mohammed Fazuluddin
 
Docker - A Quick Introduction Guide
Docker - A Quick Introduction Guide
Mohammed Fazuluddin
 
Cloud Providers and Their Key Features Explained
Cloud Providers and Their Key Features Explained
Mohammed Fazuluddin
 
Database Performance Handling : A comprehensive guide
Database Performance Handling : A comprehensive guide
Mohammed Fazuluddin
 
Design patterns Q&A | Important question and answers
Design patterns Q&A | Important question and answers
Mohammed Fazuluddin
 
Software-Requirements-to-System-Design Basics
Software-Requirements-to-System-Design Basics
Mohammed Fazuluddin
 
MEAN-vs-MERN-A-Developers-Guide and Explanation
MEAN-vs-MERN-A-Developers-Guide and Explanation
Mohammed Fazuluddin
 
Cloud AI Deployment Design Patterns - Learn the Basic Deployment Patterns
Cloud AI Deployment Design Patterns - Learn the Basic Deployment Patterns
Mohammed Fazuluddin
 
Auto-scaling-real-time-software-applications-and-best-practices.pdf
Auto-scaling-real-time-software-applications-and-best-practices.pdf
Mohammed Fazuluddin
 
Java Version(v5 -v23) Features with sample code snippet
Java Version(v5 -v23) Features with sample code snippet
Mohammed Fazuluddin
 
Cloud Architecture Framework Pillar’s.pdf
Cloud Architecture Framework Pillar’s.pdf
Mohammed Fazuluddin
 
Implementing Generative AI and Machine Learning on GCP: Architectures, Use Ca...
Implementing Generative AI and Machine Learning on GCP: Architectures, Use Ca...
Mohammed Fazuluddin
 
LEVERAGING AWS GENERATIVE AI: ARCHITECTURAL INSIGHTS AND REAL-WORLD IMPLEMENT...
LEVERAGING AWS GENERATIVE AI: ARCHITECTURAL INSIGHTS AND REAL-WORLD IMPLEMENT...
Mohammed Fazuluddin
 
Basics of GraphQL : Unlocking the Power of GraphQL
Basics of GraphQL : Unlocking the Power of GraphQL
Mohammed Fazuluddin
 
SQL Injection Introduction and Prevention
SQL Injection Introduction and Prevention
Mohammed Fazuluddin
 
Rest API Security - A quick understanding of Rest API Security
Rest API Security - A quick understanding of Rest API Security
Mohammed Fazuluddin
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
Mohammed Fazuluddin
 
Mule ESB - An Enterprise Service Bus
Mule ESB - An Enterprise Service Bus
Mohammed Fazuluddin
 
Docker - A Quick Introduction Guide
Docker - A Quick Introduction Guide
Mohammed Fazuluddin
 
Ad

Recently uploaded (20)

Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
HPE Reseller in uae by numerosystom.pptx
HPE Reseller in uae by numerosystom.pptx
aadibva452
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 
Shell Skill Tree - LabEx Certification (LabEx)
Shell Skill Tree - LabEx Certification (LabEx)
VICTOR MAESTRE RAMIREZ
 
Porting Qt 5 QML Modules to Qt 6 Webinar
Porting Qt 5 QML Modules to Qt 6 Webinar
ICS
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
OpenChain Webinar - AboutCode - Practical Compliance in One Stack – Licensing...
Shane Coughlan
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
HPE Reseller in uae by numerosystom.pptx
HPE Reseller in uae by numerosystom.pptx
aadibva452
 
Who will create the languages of the future?
Who will create the languages of the future?
Jordi Cabot
 
IObit Driver Booster Pro 12 Crack Latest Version Download
IObit Driver Booster Pro 12 Crack Latest Version Download
pcprocore
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
Sysinfo OST to PST Converter Infographic
Sysinfo OST to PST Converter Infographic
SysInfo Tools
 
SAP PM Module Level-IV Training Complete.ppt
SAP PM Module Level-IV Training Complete.ppt
MuhammadShaheryar36
 
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
Foundations of Marketo Engage - Programs, Campaigns & Beyond - June 2025
BradBedford3
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Open Source Software Development Methods
Open Source Software Development Methods
VICTOR MAESTRE RAMIREZ
 
The Anti-Masterclass Live - Peak of Data & AI 2025
The Anti-Masterclass Live - Peak of Data & AI 2025
Safe Software
 
Reimagining Software Development and DevOps with Agentic AI
Reimagining Software Development and DevOps with Agentic AI
Maxim Salnikov
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
Y - Recursion The Hard Way GopherCon EU 2025
Y - Recursion The Hard Way GopherCon EU 2025
Eleanor McHugh
 
Introduction to Agile Frameworks for Product Managers.pdf
Introduction to Agile Frameworks for Product Managers.pdf
Ali Vahed
 

React JS - A quick introduction tutorial

  • 1. React JS A Quick Introduction Tutorial Mohammed Fazuluddin
  • 2. Topics  Overview  React JS Features  React JS Architecture  React + Redux Architecture  React JS components  React JS Best Practices  Pro’s and Con’s  Useful Links
  • 3. Overview  React JS is a front-end library developed by Facebook. It is used for handling the view layer for web and mobile apps.  React JS allows us to create reusable UI components.  It is currently one of the most popular JavaScript libraries and has a strong foundation and large community behind it.  React JS is a declarative, efficient, and flexible JavaScript library for building user interfaces.  It lets you compose complex UIs from small and isolated pieces of code called “components”.  React JS is JavaScript library used for building reusable UI components.
  • 4. Overview  React JS is a library for building composable user interfaces.  React JS encourages the creation of reusable UI components, which present data that changes over time.  Lots of people use React as the V in MVC. React abstracts away the DOM from you, offering a simpler programming model and better performance.  React JS can also render on the server using Node, and it can power native apps using React Native.  React JS implements one-way reactive data flow, which reduces the boilerplate and is easier to reason about than traditional data binding.
  • 5. React JS Features  JSX − JSX is JavaScript syntax extension. It isn't necessary to use JSX in React development, but it is recommended.  Components − React is all about components. You need to think of everything as a component. This will help you maintain the code when working on larger scale projects.  Unidirectional data flow and Flux − React implements one-way data flow which makes it easy to reason about your app. Flux is a pattern that helps keeping your data unidirectional.  License − React is licensed under the Facebook Inc. Documentation is licensed under CC BY 4.0.
  • 7. React + Redux Architecture
  • 8. React JS components  State-full or class-based components  A state-full component has its state and data associated with the state.  You can pass data inside this type of component via state or props objects.  State-full components are also harder to support as they persist some data and may change the global state of the app.  State-less or function-based components  State-less components or function-based components and what React Hooks is for Function-based components are just simple JavaScript functions.  State-less function-based components have some limitations and essentially must have one global place to manage state.
  • 9. React JS components  Presentational (or high-order) components  High-Order Component (or HOC) is essentially a design pattern, also known as a Decorator Pattern.  In ReactJS, a HOC is a component that wraps another component by adding extra functionality or extra properties.  This allows abstraction from some commonly used logic and keeps your code DRY.  Container components  Container components, on the other hand, have logic to set state or have functions to emit events up to a parent component.  The general rule of the thumb is to keep your component as simple as possible with a Single Responsibility Principle design principle in mind, which essentially means your component must do one thing, but do it well.
  • 10. React JS Best Practices  When using ReduxJS, split your Reducer code into smaller methods to avoid huge JSON within your Reducer.  Use the create-react-app generator to bootstrap your ReactJS app.  Keep your code DRY. Don’t Repeat Yourself, but keep in mind code duplicate is NOT always a bad thing.  Avoid having large classes, methods or components, including Reducers.  Use more robust managers to manage application state, such as Redux.  Use event synchronizer, such as Redux-Thunk, for interactions with your back end API.  Avoid passing too many attributes or arguments. Limit yourself to five props that you pass into your component.
  • 11. React JS Best Practices  Use React JS defaultProps and React JS propTypes.  Use linter, break up lines that are too long.  Keep your own jslint configuration file.  Always use a dependency manager with a lock file, such as NPM or yarn.  Test your commonly accessed code, code that is complex and prone to bugs.  Use ES6 de-structuring for your props.  Use conditional rendering.  User `map()` to collect and render collections of components.  Use JEST to test your React JS code.
  • 12. Pro’s and Con’s  Pro’s:  Updates process is optimized and accelerated.  JSX makes components/blocks code readable. It displays how components are plugged or combined with.  React’s data binding establishes conditions for creation dynamic applications.  Prompt rendering. Using comprises methods to minimize number of DOM operations helps to optimize updating process and accelerate it.  Testable. React’s native tools are offered for testing, debugging code.  Up to date. Facebook team supports the library. Advice or code samples can be given by Facebook community.  Using React+ES6/7, application gets high-tech and is suitable for high load systems.
  • 13. Pro’s and Con’s  Con’s:  Learning curve. Being not full-featured framework it is required in-depth knowledge for integration user interface free library into MVC framework.  View-orientedness is one of the cons of React JS. It should be found 'Model' and 'Controller' to resolve 'View' problem.  Not using isomorphic approach to exploit application leads to search engines indexing problems.  Lots of developers dislike JSX Reacts documentation, manuals are difficult for newcomers’ understanding.  Reacts large size library.
  • 14. Useful Links  React JS Environment setups  https://www.tutorialspoint.com/reactjs/reactjs_environment_setup.htm  Sample Examples  https://reactjs.org/community/examples.html
  • 15. Thanks If you feel that it is helpful and worthy to share with others then please like and share the same.