Skip to content

salesforcecommercecloud/storefront-next

v1.12.1Apache-2.0

Storefront Next development skills for building React 19 storefronts on Salesforce B2C Commerce.

sfnext-state-management

Choose the right state mechanism in a Storefront Next project: loader and action data, useRouteLoaderData, URL state with useSearchParams, cookies and sessions, optimistic UI (fetcher.formData, useNavigation, useOptimistic), React context providers (BasketProvider, AuthProvider, wishlist, product-context), and small useSyncExternalStore stores such as the mini-cart store. Use for "where should this state live", "useBasket", "useAuth", "share state between components", "optimistic add to cart", "global client state", "hydration mismatch from a store", or "do I need Zustand". Do not use for fetching or mutating data (use storefront-next:sfnext-data-fetching), controlling loader re-runs (use storefront-next:sfnext-revalidation), or login flows and sessions (use storefront-next:sfnext-authentication).

Read SKILL.md at the source

Pinned to revision fe78868e0e70, so it is the text this page describes rather than whatever the author pushed since.

Files

Every link opens the file at its source, pinned to the revision this page describes.