useCartCreateCallback

The useCartCreateCallback hook returns a callback that can be used to create a cart. It must be a descendent of a CartProvider component.

Example code

Return value

A callback to create a new cart. It expects one argument that corresponds to the input you would provide to the Storefront API's cartCreate mutation.