This is a sample React app that demonstrates the use of hooks such as useState, useEffect, useRef, useReducer, useCallback and useMemo.
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.
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.
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.