1.3.0 • Published 2 years ago

@f312213213/react-shopping-cart v1.3.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years 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

2 years ago

1.2.0

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago