Skip to content

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

Notifications You must be signed in to change notification settings

kirpalsingh17/react-functional-component-hooks

Repository files navigation

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published