SlideShare a Scribd company logo
REACT
Agenda
• JavaScript Essentials
• Event loop
• React JSX
• Libraries for ClientSide Web
Applications
• React DOM
• Environmental Setup
• NPM commands
• Overview of webpack
• Babel
• React Component
• Limitations of JSX
JavaScript
Essentials
1. Variables:
• Use let, const or var to declare variables.
• let and const are block-scoped, while var is function-scoped.
2. Data Types:
• JavaScript has various data types, including numbers, strings, booleans,
arrays, objects, and more.
3. Operators:
• Arithmetic operators (+, -, *, /, %)
• Comparison operators (==, ===, !=, !==, >, <, >=, <=)
• Logical operators (&&, ||, !)
• Assignment operators (=, +=, -=, *=, /=)
4. Conditional Statements:
• if, else if, and else for decision-making.
• The switch statement for multiple branching.
JavaScript
Essentials
1. Loops:
• for, while, and do...while loops for repetitive tasks.
2. Functions:
• Define functions using the function keyword or arrow functions (()
=> {}).
• Functions can accept parameters and return values.
3. Arrays:
• Create and manipulate arrays to store lists of data.
• Use array methods like push, pop, shift, unshift, splice, and
forEach.
4. DOM Manipulation:
• JavaScript is commonly used to interact with the Document Object
Model (DOM) to modify web page content and structure.
• You can select and manipulate elements using methods like
getElementById, querySelector, and addEventListener.
JavaScript
Essentials
1. Events:
• JavaScript can handle various events such as clicks, keypresses, and
form submissions using event listeners.
2. Asynchronous Programming:
• JavaScript is single-threaded, but it supports asynchronous operations
using callbacks, promises, and async/await.
• Promises and async/await are used to handle asynchronous code more
cleanly.
3. Error Handling:
• Use try...catch blocks to handle errors gracefully.
4. JSON:
• JavaScript Object Notation (JSON) is a common format for data
exchange.
• Use JSON.parse to convert JSON data into JavaScript objects and
JSON.stringify to convert JavaScript objects into JSON.
Event Loop
The event loop is a crucial part of the runtime environment, especially in the context of asynchronous
programming. It's responsible for managing and executing tasks (events) in a non-blocking manner,
ensuring that your code remains responsive even when performing time-consuming operations.
• Call Stack: The call stack is where JavaScript keeps track of function calls. When a function is
called, it's added to the top of the stack, and when it returns, it's removed from the stack. The call
stack is synchronous and works in a last-in, first-out (LIFO) manner.
• Callback Queue (Task Queue): The callback queue is also known as the task queue. It stores
functions (callbacks) that are ready to be executed. These functions are usually added to the queue
after completing asynchronous operations, such as I/O, timers, or network requests.
• Event Loop: The event loop is a continuous process that constantly checks the call stack and the
callback queue. It's responsible for moving functions from the callback queue to the call stack,
effectively scheduling and executing asynchronous operations.
React
JSX
JSX (JavaScript XML) is a syntax extension for
JavaScript often used with React, a popular
JavaScript library for building user interfaces.
JSX allows you to write HTML-like code within
your JavaScript code, making it easier to
define the structure of your UI components.
JSX is not limited to React and can be used in
other JavaScript frameworks as well.
Libraries
When building a client-side web application with React, you can use various libraries and tools to
enhance your development process and add additional functionality to your project.
• State Management:
• Redux: A predictable state container for managing application state.
• Mobx: A simple and scalable state management library.
• Recoil: A state management library for managing and sharing the state of your React
components.
• Routing:
• React Router: A widely used library for handling client-side routing in React applications.
• Reach Router: A routing library for React that is accessible and designed with reachability in
mind.
Libraries
• UI Components and Styling:
• Material-UI: A popular library that provides pre-designed, customizable components
following the Material Design guidelines.
• Ant Design: A set of high-quality React components with a focus on enterprise applications.
• Styled-components: A library for writing CSS in your JavaScript code using tagged template
literals.
• HTTP Requests:
• Axios: A popular library for making HTTP requests from the browser.
• Fetch API: A built-in browser API for making HTTP requests, often used with libraries like
axios or as a standalone solution.
Libraries
• Form Handling:
• Formik: A library for building forms in React with ease.
• React Hook Form: A library for managing forms using React hooks.
• Authentication and Authorization:
• Firebase: A comprehensive platform that provides authentication, real-time database, cloud
functions, and more.
• Auth0: An authentication and authorization platform with various SDKs for React applications.
React
DOM
The term "React DOM" refers to the part of the React library
that is responsible for rendering your React components to
the actual Document Object Model (DOM) of a web page. It is
a specific package within the React ecosystem called "react-
dom".
import React from 'react';
import ReactDOM from 'react-dom';
const element = <h1>Hello, World!</h1>; ReactDOM.render(element,
document.getElementById('root'));
Overview
of
webpack
Webpack is a popular open-source JavaScript
module bundler that is commonly used in
modern web development. Its primary purpose
is to take various web assets, such as
JavaScript, CSS, and images, and bundle
them together into a format that is optimized for
efficient delivery to a web browser. Webpack is
highly configurable and extensible, making it a
versatile tool for managing and optimizing your
project's assets.
Install
Webpack
Install Webpack and necessary loaders and plugins:
1. npm install --save-dev webpack webpack-cli
webpack-dev-server html-webpack-plugin
2. npm install --save-dev style-loader css-loader file-
loader
Babel
Babel is an open-source JavaScript
compiler that allows developers to write
code in the latest ECMAScript (ES)
standards (such as ES6/ES2015 and
beyond) and then transform or
"transpile" that code into a backward-
compatible version of JavaScript that
can run in older web browsers or
environments.
Install
Babel
Install Babel and necessary loaders and plugins:
1. npm install --save-dev babel-loader @babel/core
@babel/preset-env @babel/preset-react
Create a file .babelrc
{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
React Component
Basic
In React, a component is a
fundamental building block that
encapsulates a piece of user
interface and its behavior. React
components can be reusable and
are used to create the UI of a web
application. There are two primary
types of components in React:
functional components and class
components.
Functional
Component
Functional components are
the simplest form of React
components. They are
JavaScript functions that
return JSX (JavaScript XML)
to describe what the UI
should look like.
Example
import React from 'react';
function HelloWorld() {
return <div>Hello, World!</div>;
}
export default HelloWorld;
Class Component
Class components are more
advanced and can hold their own
internal state, making them
suitable for more complex
interactions. They extend the
(React.Component) class and
provide additional features, such
as lifecycle methods. Class
components are sometimes
referred to as stateful
components.
Example
import React, { Component } from 'react';
class HelloWorld extends Component {
render() {
return <div>Hello, World!</div>;
}
}
export default HelloWorld;
Limitations of JSX
1. JSX requires compilation before running in the browser.
2. Complex logic and control structures can make JSX code verbose and
harder to read.
Important Points:
• Learning curve for newcomers.
• No direct HTML comments; use {/* ... */}.
• Self-closing tags should include a trailing slash.
• Use className for CSS classes.
• Wrapping elements in parentheses when multiple elements are returned.
• Potential naming conflicts with reserved words (e.g., class vs. className).
• Not enforcing accessibility; developers need to ensure accessibility
manually.
• JSX is primarily used with React for UI development.

More Related Content

PDF
react hook and wesite making structure ppt
PPTX
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
PDF
Reactjs Basics
PPTX
Reactjs notes.pptx for web development- tutorial and theory
PPTX
PDF
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
PPTX
React_Complete.pptx
PPTX
GDG Workshop on React (By Aakanksha Rai)
react hook and wesite making structure ppt
unit 2 React js.pptxdgdgdgdgdgdgdgdgdsgdgdg
Reactjs Basics
Reactjs notes.pptx for web development- tutorial and theory
Learning React js Learn React JS From Scratch with Hands On Projects 2nd Edit...
React_Complete.pptx
GDG Workshop on React (By Aakanksha Rai)

Similar to From JSX to Deployment: Mastering the React Workflow for Scalable Front-End Development (20)

PPTX
React JS - A quick introduction tutorial
PDF
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
PDF
Learn react by Etietop Demas
DOCX
Skill practical javascript diy projects
PPTX
reacts js with basic details Detailed_ReactJS_Presentation.pptx
PPTX
Unit 2 Fundamentals of React -------.pptx
PPTX
Internal workshop react-js-mruiz
PDF
Introduction to React JS
PPTX
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
PDF
FRONTEND DEVELOPMENT WITH REACT.JS
PDF
react.pdf
PDF
0900 learning-react
PDF
Fundamental concepts of react js
PPTX
React JS: A Secret Preview
PDF
ReactJS - frontend web developing reactjs
PDF
Getting Started with React, When You’re an Angular Developer
PPTX
ReactJS.pptx
PDF
Welcome to React & Flux !
PPTX
React for JavaScipt Introduction and functions
React JS - A quick introduction tutorial
reactjs-vs-angularjs-which-is-the-best-framework-for-you.pdf
Learn react by Etietop Demas
Skill practical javascript diy projects
reacts js with basic details Detailed_ReactJS_Presentation.pptx
Unit 2 Fundamentals of React -------.pptx
Internal workshop react-js-mruiz
Introduction to React JS
React JS; all concepts. Contains React Features, JSX, functional & Class comp...
FRONTEND DEVELOPMENT WITH REACT.JS
react.pdf
0900 learning-react
Fundamental concepts of react js
React JS: A Secret Preview
ReactJS - frontend web developing reactjs
Getting Started with React, When You’re an Angular Developer
ReactJS.pptx
Welcome to React & Flux !
React for JavaScipt Introduction and functions
Ad

Recently uploaded (20)

PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Complications of Minimal Access Surgery at WLH
PDF
Business Ethics Teaching Materials for college
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Basic Mud Logging Guide for educational purpose
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Week 4 Term 3 Study Techniques revisited.pptx
TR - Agricultural Crops Production NC III.pdf
Cell Structure & Organelles in detailed.
O5-L3 Freight Transport Ops (International) V1.pdf
Pharmacology of Heart Failure /Pharmacotherapy of CHF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
O7-L3 Supply Chain Operations - ICLT Program
Complications of Minimal Access Surgery at WLH
Business Ethics Teaching Materials for college
Microbial disease of the cardiovascular and lymphatic systems
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Mark Klimek Lecture Notes_240423 revision books _173037.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Insiders guide to clinical Medicine.pdf
Basic Mud Logging Guide for educational purpose
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Ad

From JSX to Deployment: Mastering the React Workflow for Scalable Front-End Development

  • 2. Agenda • JavaScript Essentials • Event loop • React JSX • Libraries for ClientSide Web Applications • React DOM • Environmental Setup • NPM commands • Overview of webpack • Babel • React Component • Limitations of JSX
  • 3. JavaScript Essentials 1. Variables: • Use let, const or var to declare variables. • let and const are block-scoped, while var is function-scoped. 2. Data Types: • JavaScript has various data types, including numbers, strings, booleans, arrays, objects, and more. 3. Operators: • Arithmetic operators (+, -, *, /, %) • Comparison operators (==, ===, !=, !==, >, <, >=, <=) • Logical operators (&&, ||, !) • Assignment operators (=, +=, -=, *=, /=) 4. Conditional Statements: • if, else if, and else for decision-making. • The switch statement for multiple branching.
  • 4. JavaScript Essentials 1. Loops: • for, while, and do...while loops for repetitive tasks. 2. Functions: • Define functions using the function keyword or arrow functions (() => {}). • Functions can accept parameters and return values. 3. Arrays: • Create and manipulate arrays to store lists of data. • Use array methods like push, pop, shift, unshift, splice, and forEach. 4. DOM Manipulation: • JavaScript is commonly used to interact with the Document Object Model (DOM) to modify web page content and structure. • You can select and manipulate elements using methods like getElementById, querySelector, and addEventListener.
  • 5. JavaScript Essentials 1. Events: • JavaScript can handle various events such as clicks, keypresses, and form submissions using event listeners. 2. Asynchronous Programming: • JavaScript is single-threaded, but it supports asynchronous operations using callbacks, promises, and async/await. • Promises and async/await are used to handle asynchronous code more cleanly. 3. Error Handling: • Use try...catch blocks to handle errors gracefully. 4. JSON: • JavaScript Object Notation (JSON) is a common format for data exchange. • Use JSON.parse to convert JSON data into JavaScript objects and JSON.stringify to convert JavaScript objects into JSON.
  • 6. Event Loop The event loop is a crucial part of the runtime environment, especially in the context of asynchronous programming. It's responsible for managing and executing tasks (events) in a non-blocking manner, ensuring that your code remains responsive even when performing time-consuming operations. • Call Stack: The call stack is where JavaScript keeps track of function calls. When a function is called, it's added to the top of the stack, and when it returns, it's removed from the stack. The call stack is synchronous and works in a last-in, first-out (LIFO) manner. • Callback Queue (Task Queue): The callback queue is also known as the task queue. It stores functions (callbacks) that are ready to be executed. These functions are usually added to the queue after completing asynchronous operations, such as I/O, timers, or network requests. • Event Loop: The event loop is a continuous process that constantly checks the call stack and the callback queue. It's responsible for moving functions from the callback queue to the call stack, effectively scheduling and executing asynchronous operations.
  • 7. React JSX JSX (JavaScript XML) is a syntax extension for JavaScript often used with React, a popular JavaScript library for building user interfaces. JSX allows you to write HTML-like code within your JavaScript code, making it easier to define the structure of your UI components. JSX is not limited to React and can be used in other JavaScript frameworks as well.
  • 8. Libraries When building a client-side web application with React, you can use various libraries and tools to enhance your development process and add additional functionality to your project. • State Management: • Redux: A predictable state container for managing application state. • Mobx: A simple and scalable state management library. • Recoil: A state management library for managing and sharing the state of your React components. • Routing: • React Router: A widely used library for handling client-side routing in React applications. • Reach Router: A routing library for React that is accessible and designed with reachability in mind.
  • 9. Libraries • UI Components and Styling: • Material-UI: A popular library that provides pre-designed, customizable components following the Material Design guidelines. • Ant Design: A set of high-quality React components with a focus on enterprise applications. • Styled-components: A library for writing CSS in your JavaScript code using tagged template literals. • HTTP Requests: • Axios: A popular library for making HTTP requests from the browser. • Fetch API: A built-in browser API for making HTTP requests, often used with libraries like axios or as a standalone solution.
  • 10. Libraries • Form Handling: • Formik: A library for building forms in React with ease. • React Hook Form: A library for managing forms using React hooks. • Authentication and Authorization: • Firebase: A comprehensive platform that provides authentication, real-time database, cloud functions, and more. • Auth0: An authentication and authorization platform with various SDKs for React applications.
  • 11. React DOM The term "React DOM" refers to the part of the React library that is responsible for rendering your React components to the actual Document Object Model (DOM) of a web page. It is a specific package within the React ecosystem called "react- dom". import React from 'react'; import ReactDOM from 'react-dom'; const element = <h1>Hello, World!</h1>; ReactDOM.render(element, document.getElementById('root'));
  • 12. Overview of webpack Webpack is a popular open-source JavaScript module bundler that is commonly used in modern web development. Its primary purpose is to take various web assets, such as JavaScript, CSS, and images, and bundle them together into a format that is optimized for efficient delivery to a web browser. Webpack is highly configurable and extensible, making it a versatile tool for managing and optimizing your project's assets.
  • 13. Install Webpack Install Webpack and necessary loaders and plugins: 1. npm install --save-dev webpack webpack-cli webpack-dev-server html-webpack-plugin 2. npm install --save-dev style-loader css-loader file- loader
  • 14. Babel Babel is an open-source JavaScript compiler that allows developers to write code in the latest ECMAScript (ES) standards (such as ES6/ES2015 and beyond) and then transform or "transpile" that code into a backward- compatible version of JavaScript that can run in older web browsers or environments.
  • 15. Install Babel Install Babel and necessary loaders and plugins: 1. npm install --save-dev babel-loader @babel/core @babel/preset-env @babel/preset-react Create a file .babelrc { "presets": [ "@babel/preset-env", "@babel/preset-react" ] }
  • 16. React Component Basic In React, a component is a fundamental building block that encapsulates a piece of user interface and its behavior. React components can be reusable and are used to create the UI of a web application. There are two primary types of components in React: functional components and class components.
  • 17. Functional Component Functional components are the simplest form of React components. They are JavaScript functions that return JSX (JavaScript XML) to describe what the UI should look like.
  • 18. Example import React from 'react'; function HelloWorld() { return <div>Hello, World!</div>; } export default HelloWorld;
  • 19. Class Component Class components are more advanced and can hold their own internal state, making them suitable for more complex interactions. They extend the (React.Component) class and provide additional features, such as lifecycle methods. Class components are sometimes referred to as stateful components.
  • 20. Example import React, { Component } from 'react'; class HelloWorld extends Component { render() { return <div>Hello, World!</div>; } } export default HelloWorld;
  • 21. Limitations of JSX 1. JSX requires compilation before running in the browser. 2. Complex logic and control structures can make JSX code verbose and harder to read. Important Points: • Learning curve for newcomers. • No direct HTML comments; use {/* ... */}. • Self-closing tags should include a trailing slash. • Use className for CSS classes. • Wrapping elements in parentheses when multiple elements are returned. • Potential naming conflicts with reserved words (e.g., class vs. className). • Not enforcing accessibility; developers need to ensure accessibility manually. • JSX is primarily used with React for UI development.