Skip to main content

Arguments

  1. string
    required
    The id of the component.
  2. object
    required
    Options for site version and locale.

Return type

Promise<MakeswiftComponentSnapshot | null>
An opaque MakeswiftComponentSnapshot object that is only intended to be rendered by <MakeswiftComponent> and <Slot>.

Examples

Basic usage

The following example shows how to fetch a page-specific component snapshot and render it using the <Slot> component within a page.
src/app/products/[slug]/page.tsx

Localization

The following example uses the locale param to fetch a localized snapshot of a page-specific component.
src/app/[locale]/products/[slug]/page.tsx

Changelog