Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NextJs][Regression] Custom Components cannot be added using Horizon #807

Merged
merged 4 commits into from
Sep 8, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/nextjs/scripts/templates/component-src.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 & {
Expand All @@ -20,7 +20,7 @@ const ${componentName} = (props: ${componentName}Props): JSX.Element => (
</div>
);

export default ${componentName};
export default withDatasourceCheck()<${componentName}Props>(${componentName});
`;
}

Expand Down