This is a shopping cart website built using React.js where customers can add clothes to their cart and update the quantities of items. Managed state using the Context API.
- Browse a collection of clothes and add items to the shopping cart
- Update the quantity of items in the shopping cart
- View the total count and price of items in the cart
- Persistent state management using the Context API and useReducer hook
-
Context API: Utilized for centralized state management and to avoid prop drilling.
-
useReducer Hook: Implemented for handling complex state logic and actions.
-
Provider Component: Modularized context and state into a dedicated provider component.
-
Context Consumption: Efficiently accessing and managing context values across the component tree.
-
State Management Integration: Linking context to state for dynamic updates.
To run this project locally, follow these steps:
- Clone this repository to your local machine:
git https://github.com/trishna456/shopping-cart.git
- Navigate to the project directory:
cd shopping-cart
- Install dependencies using npm or yarn:
npm install
# or
yarn install
- Start the development server:
npm start
# or
yarn start
- Open your web browser and navigate to http://localhost:3000 to view the app.