requireForm()function

requireForm(caller?: AnyCaller): FormStore<T>
ParamType
callerAnyCaller
Function to attribute the error to if no form context is found.
Return
FormStore<T>
The current FormStore instance.
Throws
unknown
RequiredError if called outside a Form component.

Hook that returns the current form's FormStore from context.

Examples

const form = requireForm();