diff --git a/samples/nextjs/scripts/templates/component-src.ts b/samples/nextjs/scripts/templates/component-src.ts index cd35fa1da9..f924602533 100644 --- a/samples/nextjs/scripts/templates/component-src.ts +++ b/samples/nextjs/scripts/templates/component-src.ts @@ -4,7 +4,7 @@ * @returns component src boilerplate as a string */ function generateComponentSrc(componentName: string): string { - return `import { Text, Field } from '@sitecore-jss/sitecore-jss-nextjs'; + return `import { Text, Field, withDatasourceCheck } from '@sitecore-jss/sitecore-jss-nextjs'; import { StyleguideComponentProps } from 'lib/component-props'; type ${componentName}Props = StyleguideComponentProps & { @@ -20,7 +20,7 @@ const ${componentName} = (props: ${componentName}Props): JSX.Element => ( ); -export default ${componentName}; +export default withDatasourceCheck()<${componentName}Props>(${componentName}); `; }