0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

Fix when no result

This commit is contained in:
Ben 2024-12-09 16:37:12 +07:00 committed by GitHub
parent e21c7e67fd
commit 2a09db3094
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -85,7 +85,7 @@ async function renderToStaticMarkup(Component, props, { default: children, ...sl
value: newChildren,
});
}
const formState = this ? await getFormState(this) : undefined;
const formState = this?.result ? await getFormState(this) : undefined;
if (formState) {
attrs['data-action-result'] = JSON.stringify(formState[0]);
attrs['data-action-key'] = formState[1];