Skip to content

Commit

Permalink
Use spreadAttributes
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Oct 5, 2021
1 parent 81d7c7a commit 8b36304
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/astro/src/internal/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,7 @@ export async function renderComponent(result: any, displayName: string, Componen

if(renderer === null) {
if(typeof Component === 'string') {
const propsArray = Object.entries(props);
html = await renderAstroComponent(await render`<${Component}${ propsArray.length ? ' ' + propsArray.map(([k,v]) => `"${k}"="${v}"`).join(' ') : ''}>${children}</${Component}>`);
debugger;
html = await renderAstroComponent(await render`<${Component}${spreadAttributes(props)}>${children}</${Component}>`);
} else {
throw new Error(`Astro is unable to render ${metadata.displayName}!\nIs there a renderer to handle this type of component defined in your Astro config?`);
}
Expand Down

0 comments on commit 8b36304

Please sign in to comment.