1.3.0 • Published 11 months ago

@f312213213/react-shopping-cart v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

react-shopping-cart

A react hook to make shopping cart easier.

Install

npm i @f312213213/react-shopping-cart

Quick start

import { CartProvider } from '@f312213213/react-shopping-cart';

const Store = () => {
  return (
      <CartProvider>
        <YourStoreRelatedComponents />
      </CartProvider>
  )
}
import { useCartContext } from '@f312213213/react-shopping-cart';

const OtherComponents = () => {
  const { cartItems } = useCartContext()
  return (
      {
        cartItems.map(cartItem => {
          return (
              <div>
                {
                  cartItem.id
                }
              </div>
          )
        })
      }
  )
}
1.3.0

11 months ago

1.2.0

11 months ago

1.1.2

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago