Support custom elements (#1854)

* Support custom elements

Support non-object/non-function components

* fix: ensure component is not string before throwing

Co-authored-by: Nate Moore <nate@skypack.dev>
This commit is contained in:
Jonathan Neal 2021-11-17 16:19:54 -05:00 committed by GitHub
parent 6abea78ecd
commit 739d3b971d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,7 +145,7 @@ export async function renderComponent(result: SSRResult, displayName: string, Co
}
const probableRendererNames = guessRenderers(metadata.componentUrl);
if (Array.isArray(renderers) && renderers.length === 0) {
if (Array.isArray(renderers) && renderers.length === 0 && typeof Component !== 'string') {
const message = `Unable to render ${metadata.displayName}!
There are no \`renderers\` set in your \`astro.config.mjs\` file.