Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 1.36 KB

File metadata and controls

34 lines (20 loc) · 1.36 KB

React App

This is a sample React app that demonstrates the use of hooks such as useState, useEffect, useRef, useReducer, useCallback and useMemo.

Getting Started

To run the app, follow these steps:

  • Clone the repository to your local machine.
  • Navigate to the project directory in your terminal.
  • Run the command npm install to install the project dependencies.
  • Run the command npm start to start the development server.

Components

The app contains the following components:

First: A component that demonstrates the use of useContext hook to access global state.

UseRef: A component that demonstrates the use of useRef hook to maintain a mutable reference to a value across renders.

UseReducer: A component that demonstrates the use of useReducer hook to manage complex state.

UseCallback: A component that demonstrates the use of useCallback hook to optimize performance by memoizing a function.

UseMemo: A component that demonstrates the use of useMemo hook to optimize performance by memoizing a computed value.

Hooks

The app also demonstrates the use of the following hooks:

useState: A hook that allows state to be maintained in a functional component.

useEffect: A hook that allows side effects to be performed in a functional component.

useContext: A hook that allows global state to be accessed in a functional component.