Skip to main content

useFormContext

Hook to get the Form instance from the FormContext.

import { useFormContext } from "@mozartspa/mobx-form"
function MyComponent() {
const form = useFormContext()
// use the form instance...
}
warning

In case there is no form instance, it throws an error.