Skip to content

Commit 2989f79

Browse files
authored
Add 'use server' directive to markdown renderer (#3815)
1 parent 344842f commit 2989f79

File tree

1 file changed

+3
-0
lines changed
  • packages/gitbook/src/components/DocumentView/Integration

1 file changed

+3
-0
lines changed

packages/gitbook/src/components/DocumentView/Integration/contentkit.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export const contentKitServerContext: ContentKitServerContext = {
2727
codeBlock: (props) => {
2828
return <PlainCodeBlock code={props.code} syntax={props.syntax} />;
2929
},
30+
// For some reason, Next thinks that this function is used in a client component
31+
// it's likely an issue with the compiler not being able to track the usage of this function properly
3032
markdown: async ({ className, markdown }) => {
33+
'use server';
3134
const parsed = await parseMarkdown(markdown);
3235
return <div className={className} dangerouslySetInnerHTML={{ __html: parsed }} />;
3336
},

0 commit comments

Comments
 (0)