'use client' import { useActionState } from 'react' export function Form({ foo, bar, baz, }: { foo: () => Promise bar: () => Promise baz: () => Promise }) { const [result, dispatch] = useActionState< [number, number, number], 'submit' | 'reset' >( async (_state, event) => { if (event === 'reset') { return [0, 0, 0] } return [await foo(), await bar(), await baz()] }, [0, 0, 0] ) return (
dispatch('submit')}> {' '}

{result[0]} {result[1]} {result[2]}

) }