We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In Composing Server Actions with Actions:
"use client"; import {updateName} from './actions'; function UpdateName() { const [name, setName] = useState(''); const [error, setError] = useState(null); const [isPending, startTransition] = useTransition(); const submitAction = async () => { startTransition(async () => { const {error} = await updateName(name); if (!error) { setError(error); } else { setName(''); } }) } return ( <form action={submitAction}> <input type="text" name="name" disabled={isPending}/> {state.error && <span>Failed: {state.error}</span>} </form> ) }
There is no state variable here.
It should be this
<form action={submitAction}> <input type="text" name="name" disabled={isPending}/> {error && <span>Failed: {error}</span>} </form>
https://react.dev/reference/rsc/server-actions#composing-server-actions-with-actions
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Summary
In Composing Server Actions with Actions:
There is no state variable here.
It should be this
Page
https://react.dev/reference/rsc/server-actions#composing-server-actions-with-actions
Details
No response
The text was updated successfully, but these errors were encountered: