Files
Zack TannerandGitHub 89242ec1b5 unskip middleware deploy test (#70264)
This whole test suite was disabled but only 2 tests rely on runtime
logs, so this refactors the test to remove the runtime log dependency in
favor of returning the output from the action and reading from the DOM.
2024-09-19 14:00:17 -07:00

17 lines
361 B
JavaScript

'use client'
import { useActionState } from 'react'
export function Form({ action }) {
const [state, formAction] = useActionState(action, null)
return (
<form action={formAction}>
<div id="action-result">Action Result: {state}</div>
<button type="submit" id="submit-server-action">
server action
</button>
</form>
)
}