Skip to content

Latest commit

 

History

History
35 lines (18 loc) · 2.19 KB

README1.md

File metadata and controls

35 lines (18 loc) · 2.19 KB

The react-router-dom package is commonly used in React applications for implementing client-side routing.

Client-side routing, also known as single-page application (SPA) routing, is a technique used in web applications to handle navigation and page transitions on the client side without performing a full page reload.

Traditionally, when a user clicks on a link or submits a form on a web page, the browser sends a requ est to the server, and the server responds by sending a new HTML page. This process is known as server-side rendering (SSR)

Frameworks and libraries like React Router, Vue Router, and Angular Router provide client-side routing capabilities

entire application is loaded upfront and subsequent navigation happens within the same page

input given to a function is called props

destructures the props object into individual variables count and auth. can be used directly with name

The useNavigate() hook is typically used in React applications that utilize client-side routing, specifically with a library like React Router. It provides a programmatic way to navigate or redirect to different routes within the application.

useState(""): This is a hook provided by React that allows you to add state to functional components.

The request payload refers to the data that is sent from the client (such as a web browser) to the server as part of an HTTP request

throw new Error(...) it throws error and catched by catch block used for exceotion handling

  • represents not found for routing React.StrictMode-> is a built-in component provided by React that performs additional checks and warnings during development to help identify potential issues in your code.

These components are part of the 'mdb-react-ui-kit' package, which provides a collection of ready-to-use UI components and styles for building responsive web applications. By importing these components, you can utilize them in your React components to create visually appealing and interactive user interfaces.

I have made a useeffect in App js as soon as we enter any link than useeffect is called and it checks whether you are authenticated or not by calling an api of backend if you are not logged in than navigate sends you back "/" page.