fix: only validate when components is defined
This commit is contained in:
parent
6e8ba96da9
commit
73af50ba20
1 changed files with 4 additions and 2 deletions
|
@ -7,13 +7,15 @@ import RenderNode from './RenderNode.astro';
|
|||
|
||||
type Props = {
|
||||
content: RenderableTreeNode;
|
||||
components: Record<string, AstroInstance['default']>;
|
||||
components?: Record<string, AstroInstance['default']>;
|
||||
};
|
||||
|
||||
const { content, components } = Astro.props as Props;
|
||||
|
||||
// Will throw if components is invalid
|
||||
validateComponentsProp(components);
|
||||
if (components) {
|
||||
validateComponentsProp(components);
|
||||
}
|
||||
---
|
||||
|
||||
<RenderNode node={createAstroNode(content, components)} />
|
||||
|
|
Loading…
Reference in a new issue