Skip to content

Commit

Permalink
Fix/update spread attribute (#7310)
Browse files Browse the repository at this point in the history
* fix: add default fallback for spreadAttributes values

* chore: add PR changeset

* chore: fix pnpm lock

---------

Co-authored-by: Nate Moore <[email protected]>
  • Loading branch information
Edo-San and natemoo-re authored Jun 8, 2023
1 parent e6bff65 commit 52f0480
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/blue-spies-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Fixed a bug that threw an Exception when spreading potentially undefined values as HTML attributes
2 changes: 1 addition & 1 deletion packages/astro/src/runtime/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export function __astro_tag_component__(Component: unknown, rendererName: string

// Adds support for `<Component {...value} />
export function spreadAttributes(
values: Record<any, any>,
values: Record<any, any> = {},
_name?: string,
{ class: scopedClassName }: { class?: string } = {}
) {
Expand Down

0 comments on commit 52f0480

Please sign in to comment.