add-to-cart-button
v1.0.16
Published
Simple add to cart button
Downloads
8
Readme
🚀 Simple add to cart button for ecommerce apps
Installation
npm install add-to-cart-button
Usage
import { AddToCartButton } from 'add-to-cart-button'
....
const [isAdded, setIsAdded] = useState(false);
....
const handleAdd = () => {
setIsAdded(v => !v)
}
....
<AddToCartButton handleAdd={handleAdd} isAdded={isAdded} />
...