next.js/examples/cms-sitecore-xmcloud/src/lib/component-props/index.ts
index.ts24 lines578 B
import {
  ComponentParams,
  ComponentRendering,
  SitecoreContextValue,
} from "@sitecore-jss/sitecore-jss-nextjs";

/**
 * Shared component props
 */
export type ComponentProps = {
  rendering: ComponentRendering;
  params: ComponentParams;
};

/**
 * Component props with context
 * You can access `sitecoreContext` by withSitecoreContext/useSitecoreContext
 * @example withSitecoreContext()(ContentBlock)
 * @example const { sitecoreContext } = useSitecoreContext()
 */
export type ComponentWithContextProps = ComponentProps & {
  sitecoreContext: SitecoreContextValue;
};
Quest for Codev2.0.0
/
SIGN IN