@dimah-form/react
v0.6.0
Published
Thin React client for dimah-form — typed hooks and protocol access
Maintainers
Readme
@dimah-form/react
Thin React client for dimah-form. createFormClient() returns the protocol API plus bound hooks. Re-export those from the instance so the protocol client, $Infer, and field types stay tied to it. Bound hooks do not need Provider. Bound useFormResponse<"catalogKey"> types answers from $Infer. Fill-session answers default to FormAnswers. Define shared field types from @dimah-form/core (this package is "use client"). Pass the same fieldTypes as dimahForm, or register them on defineClientPlugin. No field widgets — you render visibleFields / field(id).
Install
pnpm add @dimah-form/reactimport { createFormClient } from "@dimah-form/react";
import type { Form } from "./form";
import { fieldTypes } from "./field-types";
export const formClient = createFormClient<Form>({ fieldTypes });
export const { useFormClient, useFormResponse } = formClient;License
MIT
