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...
}

Stay tuned

Join 1,000+ subscribers and receive monthly tips & updates on new Ariakit content.

No spam. Unsubscribe anytime. Read latest issue