diff --git a/src/components/forms/context/Form/Form.stories.tsx b/src/components/forms/context/Form/Form.stories.tsx index f20efb3..f7040c3 100644 --- a/src/components/forms/context/Form/Form.stories.tsx +++ b/src/components/forms/context/Form/Form.stories.tsx @@ -21,7 +21,8 @@ type Story = StoryObj; const FormWithState = (props: React.ComponentProps) => { const action = async (previousState: unknown, formData: FormData): Promise => { if (typeof props.action === 'function') { - return props.action?.(formData) ?? null; + await props.action?.(formData); + return null; } return null; }; @@ -77,7 +78,7 @@ export const Standard: Story = { //onSubmit: (event) => { event.preventDefault(); console.log('submit', event); }, action: (formData) => { //console.log('action', formData.get('field-1')); - return [...formData.entries()].reduce( + const result = [...formData.entries()].reduce( (acc, [fieldKey, field]) => { if (Object.hasOwn(acc, fieldKey)) { console.warn(`Found duplicate entries for key ${fieldKey}`); @@ -87,6 +88,7 @@ export const Standard: Story = { }, {} as Record, ); + return; // FIXME: form actions now return type `void | Promise` }, children: ( <>