Skip to content

fix: resolve broken react hook import for useCart#514

Open
devprashant19 wants to merge 3 commits into
niharika-mente:mainfrom
devprashant19:fix/react-hook-import
Open

fix: resolve broken react hook import for useCart#514
devprashant19 wants to merge 3 commits into
niharika-mente:mainfrom
devprashant19:fix/react-hook-import

Conversation

@devprashant19

Copy link
Copy Markdown
Contributor

Description

This PR fixes a bug on the Product Details page where missing and incorrect hooks caused the frontend to crash when users attempted to add products to their cart.
Fixes #489

Changes

  • FRONTEND/src/pages/ProductPage.jsx:
    • Added missing imports for useCartStore and useRecentlyViewed.
    • Updated the destructuring logic from useCart() (which was non-existent) to the correct useCartStore() Zustand hook to correctly extract the addToCart method.

@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@devprashant19 is attempting to deploy a commit to the niharika-mente's projects Team on Vercel.

A member of the Team first needs to authorize it.

Aamod007
Aamod007 previously approved these changes Jul 2, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Aamod007 Aamod007 self-requested a review July 2, 2026 17:40
@devprashant19

Copy link
Copy Markdown
Contributor Author

@Aamod007 fixed merge conflicts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Broken React Hook Import (useCart)

2 participants