Wix Business Solution Contexts

Wix business solutions provide React contexts to pages, containers, and sections on Studio Two sites. Editor React Components (ERCs) placed inside these areas can read a context's current values and call its functions. For example, the Stores Product Context holds a product's details, its price and stock, and the site visitor's selected options. It also includes functions for actions such as adding the selected product to the cart. When the site visitor changes their selection, the values that depend on it, such as price and stock, update for every ERC that reads them.

This reference documents what each Wix business solution context is for, where it's available, and each of its properties and actions.

An ERC's code reads a context by calling the context's React hook, such as useProductContext() from @wix/stores/context/product, and uses the properties and functions the hook returns:

Copy

The ERC also declares the context in its manifest, by adding the hook's import path to contextDependencies.

Where a context is available

Each context's introduction lists where the context is available. A Wix business solution makes a context available in one of these ways:

  • A page the business solution sets up. Some pages always provide a context. For example, a Stores product page provides the Product Context for the product in its URL.
  • A Data Source a Wix user attaches. In the Studio Two editor, a business solution's context provider appears as a Data Source. When a Wix user attaches a Data Source to a page, container, or section, the ERCs inside it can read its context. For example, a Wix user can attach the Product Data Source to a section on the homepage and choose a product in its settings.
  • An item in a list. Some list elements provide a context for each of their items. For example, each Product Item in a Product List provides the Product Context for that item's product.

If an ERC calls a context's hook anywhere else, the hook throws an error.

Use a context in an ERC you build

Use a context in your ERC's code when you want the component to adapt to where a Wix user places it, so the Wix user doesn't have to configure it. For example, a price display that reads the Product Context shows the price of the product that the context provides.

You can use a context in an ERC that's part of a Studio Two site's project. For the steps, see Use a Wix Context in an Editor React Component in Studio Two.

Hooks and editor binding

This reference documents the properties and functions for ERCs that read a context using React hooks in their own code. In Studio Two, a Wix user can also connect an ERC's props to a context's values in the editor, and the ERC receives them as ordinary props. To choose between the two, see Component Integration Patterns.

Wix contexts and custom contexts

This reference covers the contexts that Wix business solutions provide. You can also share state between components on a site by building your own context provider, which also appears in the editor as a Data Source. You can build one only on a Studio Two site. Apps can't currently provide contexts. To learn more, see Context Providers and About Context Provider Extensions.

See also

Last updated: 1 November 2026

Did this help?