[PPT]Advanced Front-End Development with React
[PPT]Advanced Front-End Development with React
CONTENT
REACT HOOKS: USESTATE & USEEFFECT
Note:
You can’t use capital letters in naming
your file.
Note:
Wait while its installing (it may take a
few minutes).
HOW TO SET UP YOUR REACT PROJECT
Method Used:
componentWillUnmount(): Used for cleanup,
like stopping timers or removing listeners.
MOUNTING PHASE
UPDATING PHASE
UNMOUNTING PHASE
WHAT IS ROUTING?
a mechanism that determines how an application responds to a
client request for a specific endpoint, which is a path in the URL.
Routing allows developers to map URLs to specific resources,
functions, or components, making it crucial for navigating and
organizing a web application’s content.
HASH-ROUTER
Useful when deploying on static file hosts that don’t
support client-side routing. It uses the hash portion of
the URL (e.g., /about becomes /#/about).
ROUTES AND ROUTE COMPONENT
ROUTE
Defines individual paths or “routes” in the application
and specifies which component to render for each route.
ROUTES
Wraps multiple Route components and helps to define
the main route structure. This helps the app know which
component to render based on the URL.
LINK COMPONENT
Link and NavLink are used to navigate between routes
without reloading the page. Unlike traditional anchor
tags, they prevent a full page reload, making transitions
faster.
NESTED ROUTING
React Router also supports nested routes, allowing you
to organize components hierarchically and render
subcomponents based on the parent route.
DYNAMIC ROUTING
Dynamic parameters allow you to create routes that
capture parts of the URL as variables, like /user/:id, which
can render a different component based on the id
provided.
NAVIGATE COMPONENT
For programmatic navigation, React Router provides a
Navigate component and the useNavigate hook, which
help redirect users to different routes based on certain
conditions.
ADVANTAGES OF USING
REACT ROUTER
Enables smooth transitions and a more
responsive user experience.
Helps organize the application into
meaningful, navigable components.
Great for handling complex app flows and
allows for nested and dynamic routes.
MANAGING COMPLEX
STATE WITH REDUX OR
CONTEXT API
What is State Management?
State management refers to the process of managing the state of an application. The state is a piece of an object that holds the data
that can change over time and affect the looks(rendering) and behavior of the application.
Advantages:
Easy to implement and use
Already built into React
Simple syntax with less boilerplate
Disadvantages:
It can lead to performance issues if not used correctly
Not ideal for managing complex states like analytics, user data etc.
MANAGING COMPLEX
STATE WITH REDUX OR
CONTEXT API
OUTPUT
MANAGING COMPLEX
STATE WITH REDUX OR
CONTEXT API
Redux
What is Redux?
Redux is an open-source JavaScript library for managing and centralizing application state. It is one of the, if not the most popular
library for managing complex state in React applications of all sizes.