Skip to content

Commit 56d8c0f

Browse files
authored
fix: ensure action function returns object (#9848)
1 parent 4717d2a commit 56d8c0f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/old-mails-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: ensure action function returns object

packages/svelte/src/internal/client/render.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2148,7 +2148,7 @@ export function action(dom, action, value_fn) {
21482148
const value = value_fn();
21492149
untrack(() => {
21502150
if (payload === undefined) {
2151-
payload = action(dom, value);
2151+
payload = action(dom, value) || {};
21522152
} else {
21532153
const update = payload.update;
21542154
if (typeof update === 'function') {

0 commit comments

Comments
 (0)