Refactor import statements and error handling in CMS renderers
The commit updates the way 'Markdoc' is imported in the Keystatic content renderer. It also introduces type checks for imports in the core renderer package. For better error handling, a console.error message has been added for unknown CMS client types.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
|
||||
import Markdoc from '@markdoc/markdoc';
|
||||
const Markdoc = await import('@markdoc/markdoc');
|
||||
|
||||
export function KeystaticDocumentRenderer({ content }: { content: unknown }) {
|
||||
return Markdoc.renderers.react(content as string, React);
|
||||
|
||||
Reference in New Issue
Block a user