CartProvider

cart · /react·component

Root context provider for the Nordcom cart. Manages the optimistic mutation queue, projects the cart for all slice hooks, synchronizes state with cross-tab broadcasts, and optionally keeps buyer identity in sync via a client auth bridge.

Signature

@nordcom/commerce-cart
function CartProvider(props: CartProviderProps<Cfg>): Element;

Parameters

NameTypeDescription
propsCartProviderProps<Cfg>

Returns

A stack of React context providers wrapping children.

Example

<CartProvider
  kernelSnapshot={kernelSnapshot}
  submitMutation={submitCartMutation}
  initialCart={initialCart}
  shopId={shop.id}
>
  {children}
</CartProvider>

CartDevtools CartFormProps CartProviderProps AppCartConfig BaseCartActions BuyerIdentityActions CartActions CartAttributeActions

Metadata@nordcom/commerce-cart@0.2.2Open in GitHub ↗

On this page