SlideShare a Scribd company logo
ReactJs
NUTIFAFA K GEDZA
ReactJs
• ReactJS is one of the most popular JavaScript front-end
libraries
• Has a strong foundation and a large community.
• Building reusable UI components
• It is an open-source, component-based front end library
which is responsible only for the view layer of the
application.
• Applications run faster on ReactJs
• The JavaScript virtual DOM is faster than the regular DOM
• We can use ReactJS on the client and server-side as well as
with other frames
ReactJs
• A ReactJS application is made up of multiple components, each
component responsible for outputting a small, reusable piece of
HTML code.
• React components are the building blocks of a React application.
• They are reusable, self-contained pieces of UI that can be combined
to build complex interfaces.
ReactJs React Environment Setup
• Pre-requisite for ReactJS
• NodeJS
• NPM – Node Package Manager
• Npm allows developers to manage their dependencies.
• Dependencies are basically libraries or packages that the project
needs to function
Installing Node.js and npm
• Visit Node.js official website.
• Download the LTS (Long Term Support) version for stability.
• Follow the installation instructions for your operating system.
• Verify the Installation:
• Open your terminal or command prompt and run:
• node --version
• npm --version
Creating a New React Application
• The easiest way to create a new React application is by using create-
react-app,
• a command-line tool that sets up a new React project with a sensible
default configuration.
• Using npx:
• npx comes with npm 5.2+ and higher. It allows you to run commands
from packages without globally installing them.
Creating a New React Application
• Create a directory folder on your desktop/location of your choice
• Type npx create-react-app my-app
• This command creates a new directory called my-app with a basic
React project structure and installs all necessary dependencies.
• Why npx?
• npx comes with npm 5.2+ and higher. It allows you to run commands
from packages without globally installing them.
Creating a New React Application
• Once the project setup is complete, navigate into the project
directory and start the development server:
• To start the development server, type npm start
• This command starts the development server and opens your new
React application in the default web browser, typically at
http://localhost:3000.
Creating a New React Application
• Once the project setup is complete, navigate into the project
directory and start the development server:
• To start the development server, type npm start
• This command starts the development server and opens your new
React application in the default web browser, typically at
http://localhost:3000.
Recommended Extensions for React
Development:
• ESLint: Provides linting capabilities to help you write error-free JavaScript and JSX.
• Prettier: An opinionated code formatter that helps maintain consistent code style.
• React Developer Tools: Allows you to inspect the React component hierarchy in
the browser’s developer tools.
• ESLint.
• Prettier
• React Developer Tools
Project Structure Overview
• node_modules/: Contains all the dependencies installed via npm.
• public/: Publicly accessible files, including the index.html file.
• src/: Source files for your React application.
• index.js: Entry point for the React application.
• App.js: Main App component.
• App.css: Styles for the App component.
• .gitignore: Specifies which files and directories should be ignored
by Git.
• package.json: Lists project details and dependencies.
• README.md: Contains information about the project.
React Features
• JSX -JSX stands for JavaScript XML.
• Components - ReactJS application is made up of multiple
components, and each component has its own logic and controls.
• One-way Data Binding - ReactJS is designed in such a manner that
follows unidirectional data flow or one-way data binding.
• Virtual DOM-A virtual DOM object is a representation of the
original DOM object.
• Simplicity - ReactJS uses JSX file which makes the application
simple and to code as well as understand.
• Performance -This feature makes it much better than other
frameworks out there today.
Advantages
• Easy to learn and use.
• Creating Dynamic Web Applications Becomes Easier
• Reusable Components.
• Performance Enhancement
• The Support of Handy Tools
• Known to be SEO Friendly
• Scope for Testing the Codes
Disvantages
• The high pace of development
• Poor Documentation
• View Part
• JSX as a barrier
React Routing
• Routing is simply the ability to move between different parts of an
application when a user enters a URL or clicks an element :link,
button, icon, image, etc.
• Routing plays an important role in building responsive and user-
friendly web applications.
• React Router is a declarative, component-based, client and server-side
routing library for React.
React Routing
• Since the React framework doesn’t come with in-built routing, React
Router is the most popular solution for adding routing to a React
application.
• To create a React application using create-react-app, go to your
preferred CMD and type:
• npx create-react-app “router-name”
Creating a react router application
• To create a React application using create-react-app, go to your
preferred CMD and type:
• npx create-react-app “router-name”
• Once the application has been successfully created, switch to the app
directory
• Run the command using npm start
Installing React Router
• I mentioned earlier that React Router is an external library
and not part of React itself.:
• npm install react-router-dom
• Now that the router package is installed, we may proceed with
configuring the React Router library in our application.
Setting up React Router
• To enable routing in our React application, we have to
import the BrowserRouter module from react-router-dom
inside the index.js file
• then wrap the App.js component inside the BrowserRouter
component.

More Related Content

PPTX
GDG Workshop on React (By Aakanksha Rai)
PPTX
How create react app help in creating a new react applications
PPTX
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
PPTX
Introduction to React native
PPTX
Introduction to angular | Concepts and Environment setup
PPTX
Get acquainted with the new ASP.Net 5
PPTX
React_Introwvq2t2e2ewqtwtq31tef12duction.pptx
PPTX
Devops
GDG Workshop on React (By Aakanksha Rai)
How create react app help in creating a new react applications
NEXTjs.pptxfggfgfdgfgfdgfdgfdgfdgfdgfdgfg
Introduction to React native
Introduction to angular | Concepts and Environment setup
Get acquainted with the new ASP.Net 5
React_Introwvq2t2e2ewqtwtq31tef12duction.pptx
Devops

Similar to INTRODUCTION TO REACT JAVASCRIPT FOR BEGINNERS.pptx (20)

PPTX
Reactjs notes.pptx for web development- tutorial and theory
PDF
React - Inroduction and Fundamentals.pdf
PPTX
Full Stack_Reac web Development and Application
PPTX
Advanced Web Technology.pptx
PPTX
UNITde II - Docker-Containerization.pptx,
PDF
Lecture11_LaravelGetStarted_SPring2023.pdf
PDF
PDF
next-230524050805-d1e22a49.pdferewrewrewrewr
PDF
Rami Sayar - Node microservices with Docker
PPTX
reacts js with basic details Detailed_ReactJS_Presentation.pptx
PDF
Microservices: How loose is loosely coupled?
PDF
Containers, microservices and serverless for realists
PDF
UKLUG 2012 - XPages, Beyond the basics
PPTX
ma-formation-en-Docker-jlklk,nknkjn.pptx
KEY
Building production-quality apps with Node.js
PDF
ReactJS Development Services for Advanced Web Development
PPTX
Progressive Web Apps and React
PDF
Asp.Net Core MVC , Razor page , Entity Framework Core
PPTX
Mastering React: Building Modern and Interactive User Interfaces
DOCX
Gaganjot Kaur- The Nx Workspace.docx
Reactjs notes.pptx for web development- tutorial and theory
React - Inroduction and Fundamentals.pdf
Full Stack_Reac web Development and Application
Advanced Web Technology.pptx
UNITde II - Docker-Containerization.pptx,
Lecture11_LaravelGetStarted_SPring2023.pdf
next-230524050805-d1e22a49.pdferewrewrewrewr
Rami Sayar - Node microservices with Docker
reacts js with basic details Detailed_ReactJS_Presentation.pptx
Microservices: How loose is loosely coupled?
Containers, microservices and serverless for realists
UKLUG 2012 - XPages, Beyond the basics
ma-formation-en-Docker-jlklk,nknkjn.pptx
Building production-quality apps with Node.js
ReactJS Development Services for Advanced Web Development
Progressive Web Apps and React
Asp.Net Core MVC , Razor page , Entity Framework Core
Mastering React: Building Modern and Interactive User Interfaces
Gaganjot Kaur- The Nx Workspace.docx
Ad

Recently uploaded (20)

PPTX
Introduction to Artificial Intelligence
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
medical staffing services at VALiNTRY
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
System and Network Administration Chapter 2
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
Digital Strategies for Manufacturing Companies
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
Introduction to Artificial Intelligence
Operating system designcfffgfgggggggvggggggggg
Which alternative to Crystal Reports is best for small or large businesses.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
ManageIQ - Sprint 268 Review - Slide Deck
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Online Work Permit System for Fast Permit Processing
VVF-Customer-Presentation2025-Ver1.9.pptx
medical staffing services at VALiNTRY
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Softaken Excel to vCard Converter Software.pdf
System and Network Administration Chapter 2
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Digital Strategies for Manufacturing Companies
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
How to Migrate SBCGlobal Email to Yahoo Easily
Ad

INTRODUCTION TO REACT JAVASCRIPT FOR BEGINNERS.pptx

  • 2. ReactJs • ReactJS is one of the most popular JavaScript front-end libraries • Has a strong foundation and a large community. • Building reusable UI components • It is an open-source, component-based front end library which is responsible only for the view layer of the application. • Applications run faster on ReactJs • The JavaScript virtual DOM is faster than the regular DOM • We can use ReactJS on the client and server-side as well as with other frames
  • 3. ReactJs • A ReactJS application is made up of multiple components, each component responsible for outputting a small, reusable piece of HTML code. • React components are the building blocks of a React application. • They are reusable, self-contained pieces of UI that can be combined to build complex interfaces.
  • 4. ReactJs React Environment Setup • Pre-requisite for ReactJS • NodeJS • NPM – Node Package Manager • Npm allows developers to manage their dependencies. • Dependencies are basically libraries or packages that the project needs to function
  • 5. Installing Node.js and npm • Visit Node.js official website. • Download the LTS (Long Term Support) version for stability. • Follow the installation instructions for your operating system. • Verify the Installation: • Open your terminal or command prompt and run: • node --version • npm --version
  • 6. Creating a New React Application • The easiest way to create a new React application is by using create- react-app, • a command-line tool that sets up a new React project with a sensible default configuration. • Using npx: • npx comes with npm 5.2+ and higher. It allows you to run commands from packages without globally installing them.
  • 7. Creating a New React Application • Create a directory folder on your desktop/location of your choice • Type npx create-react-app my-app • This command creates a new directory called my-app with a basic React project structure and installs all necessary dependencies. • Why npx? • npx comes with npm 5.2+ and higher. It allows you to run commands from packages without globally installing them.
  • 8. Creating a New React Application • Once the project setup is complete, navigate into the project directory and start the development server: • To start the development server, type npm start • This command starts the development server and opens your new React application in the default web browser, typically at http://localhost:3000.
  • 9. Creating a New React Application • Once the project setup is complete, navigate into the project directory and start the development server: • To start the development server, type npm start • This command starts the development server and opens your new React application in the default web browser, typically at http://localhost:3000.
  • 10. Recommended Extensions for React Development: • ESLint: Provides linting capabilities to help you write error-free JavaScript and JSX. • Prettier: An opinionated code formatter that helps maintain consistent code style. • React Developer Tools: Allows you to inspect the React component hierarchy in the browser’s developer tools. • ESLint. • Prettier • React Developer Tools
  • 11. Project Structure Overview • node_modules/: Contains all the dependencies installed via npm. • public/: Publicly accessible files, including the index.html file. • src/: Source files for your React application. • index.js: Entry point for the React application. • App.js: Main App component. • App.css: Styles for the App component. • .gitignore: Specifies which files and directories should be ignored by Git. • package.json: Lists project details and dependencies. • README.md: Contains information about the project.
  • 12. React Features • JSX -JSX stands for JavaScript XML. • Components - ReactJS application is made up of multiple components, and each component has its own logic and controls. • One-way Data Binding - ReactJS is designed in such a manner that follows unidirectional data flow or one-way data binding. • Virtual DOM-A virtual DOM object is a representation of the original DOM object. • Simplicity - ReactJS uses JSX file which makes the application simple and to code as well as understand. • Performance -This feature makes it much better than other frameworks out there today.
  • 13. Advantages • Easy to learn and use. • Creating Dynamic Web Applications Becomes Easier • Reusable Components. • Performance Enhancement • The Support of Handy Tools • Known to be SEO Friendly • Scope for Testing the Codes
  • 14. Disvantages • The high pace of development • Poor Documentation • View Part • JSX as a barrier
  • 15. React Routing • Routing is simply the ability to move between different parts of an application when a user enters a URL or clicks an element :link, button, icon, image, etc. • Routing plays an important role in building responsive and user- friendly web applications. • React Router is a declarative, component-based, client and server-side routing library for React.
  • 16. React Routing • Since the React framework doesn’t come with in-built routing, React Router is the most popular solution for adding routing to a React application. • To create a React application using create-react-app, go to your preferred CMD and type: • npx create-react-app “router-name”
  • 17. Creating a react router application • To create a React application using create-react-app, go to your preferred CMD and type: • npx create-react-app “router-name” • Once the application has been successfully created, switch to the app directory • Run the command using npm start
  • 18. Installing React Router • I mentioned earlier that React Router is an external library and not part of React itself.: • npm install react-router-dom • Now that the router package is installed, we may proceed with configuring the React Router library in our application.
  • 19. Setting up React Router • To enable routing in our React application, we have to import the BrowserRouter module from react-router-dom inside the index.js file • then wrap the App.js component inside the BrowserRouter component.