requireForm()function
requireForm(caller?: AnyCaller): FormStore<T>
| Param | Type | |
|---|---|---|
caller | AnyCaller | 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();