@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
8 lines (7 loc) • 421 B
JavaScript
'use client';
import { EVENTS, useSfEvents } from '../../pages/useSfEvents';
import { RenderWidgetService } from '../../services/render-widget-service';
export function RenderLazyForCSR(props) {
const [models] = useSfEvents(EVENTS.PERSONALIZED_WIDGETS_LOADED, true);
return models && models[props.id] && !models[props.id].ssr && RenderWidgetService.createComponent(models[props.id].data, props.requestContext);
}