Arguments
-
The id of the component.
-
Options for site version and locale.
Return type
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 thelocale param to fetch a localized snapshot of a page-specific component.
src/app/[locale]/products/[slug]/page.tsx
Changelog
| Version | Changes |
|---|---|
v0.23.0 | getComponentSnapshot method introduced |