Ariakit
/

useFormContext

Returns the form store from the nearest form container.

Code examples

function FormInput() {
const store = useFormContext();
if (!store) {
throw new Error("FormInput must be wrapped in FormProvider");
}
// Use the store...
}

Follow updates

Join 1,000+ subscribers and receive monthly updates with the latest improvements on API Reference.

Read latest issue

No Spam. Unsubscribe at any time.