I’m currently tweaking with the structured content from Dato.
Is there somewhere I can find documentation about the renderNode()
function?
Here is my use case:
I’m using Astro as SSG, and it allows creating (HTML) components. I have a custom image component, and I would like to use to render images in structured text fields.
Currently, I’m doing something like:
return renderNode(
"figure",
{},
renderNode("img", { src: record.image.url, alt: record.image.alt })
);
But I’m wondering if there is a way to do something like
return renderNode(
"figure",
{},
renderNode("Image", { src: record.image.url, alt: record.image.alt })
);
with Image
being my custom image component.
Thanks