mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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.
17 lines
361 B
JavaScript
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>
|
|
)
|
|
}
|