Accepting Other Sections as Parameters in Your Section
Section
. The Section
type is a generic type that
represents any other section in deco.
Section
type from deco/blocks/section.ts
.
myProp
, which is of type Section
.
Component
and props
properties
from the myProp
prop. The Component
property represents the component
function of the section passed as a parameter, and the props
property
contains the props of that section.ProductCardSection
that renders a product
card based on certain props:
ProductContainerSection
,
which accepts a ProductCardSection
as a parameter and wraps it in a container:
ProductContainerSection
to wrap any other
section, including the ProductCardSection
, and add a container around it.
Now, let’s say you want restrict your section to ProductCard
because you have
a lot of sections in your site but only that one should fit in that place, you
can do the following:
ProductCard
: