Skip to content

v.1.3.0@next Action state in Form Context

Pre-release
Pre-release
Compare
Choose a tag to compare
@MiroslavPetrik MiroslavPetrik released this 19 Dec 14:35

New API:

  • New createForm helper to create form using <FormContext>
"use client";
import { createForm } from "react-form-action/client";
// The form renders the classic "render-props Form" and passes the state to FormContext
const { Form } = createForm(action);
  • New hook to access the state of the FormContext
import { useFormContext } from "react-form-action/client";