import { type Accessor, createRenderEffect, onCleanup, untrack, } from "solid-js"; import type { FieldRegistration, MutableRef } from "../field-context"; import { useFieldRootContext } from "../field-context"; export interface UseFieldControlRegistrationParameters { /** * Accessor for the control's current value. Tracked via `useValueChanged` * so the registration is re-pushed whenever the value flips. * * Pass a plain `() => boolean` for checkbox/switch, `() => string` for * radio value bindings, etc. */ value: Accessor; /** * Per-control id. Used as the key in `FormContext.formRef.current.fields`, * and must be stable across the control's lifetime. */ id: Accessor; /** * Ref to the visible control element (the `