Still cannot use useFormStatus with shad cn forms #3890
Unanswered
chrisarrow90
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to add a disabled attribute to my form button while the form is submitting however it seems
useFormStatus()
is still not supported with server actions and shadcn forms.I extracted my button into it's own component as per the React guidelines. However the button still doesn't get disabled on submission.
`const SubmitButton = ({ children }) => {
const status = useFormStatus()
const { pending } = useFormStatus()
return (
{pending && }
{children}
)
}
export default SubmitButton`
Beta Was this translation helpful? Give feedback.
All reactions