(opts: CreateFormHookProps<TComponents, TFormComponents>)
| 248 | } |
| 249 | |
| 250 | export function createFormHook< |
| 251 | const TComponents extends Record<string, Component<any>>, |
| 252 | const TFormComponents extends Record<string, Component<any>>, |
| 253 | >(opts: CreateFormHookProps<TComponents, TFormComponents>) { |
| 254 | function useAppForm< |
| 255 | TFormData, |
| 256 | TOnMount extends undefined | FormValidateOrFn<TFormData>, |
| 257 | TOnChange extends undefined | FormValidateOrFn<TFormData>, |
| 258 | TOnChangeAsync extends undefined | FormAsyncValidateOrFn<TFormData>, |
| 259 | TOnBlur extends undefined | FormValidateOrFn<TFormData>, |
| 260 | TOnBlurAsync extends undefined | FormAsyncValidateOrFn<TFormData>, |
| 261 | TOnSubmit extends undefined | FormValidateOrFn<TFormData>, |
| 262 | TOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TFormData>, |
| 263 | TOnDynamic extends undefined | FormValidateOrFn<TFormData>, |
| 264 | TOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TFormData>, |
| 265 | TOnServer extends undefined | FormAsyncValidateOrFn<TFormData>, |
| 266 | TSubmitMeta, |
| 267 | >( |
| 268 | props: Accessor< |
| 269 | FormOptions< |
| 270 | TFormData, |
| 271 | TOnMount, |
| 272 | TOnChange, |
| 273 | TOnChangeAsync, |
| 274 | TOnBlur, |
| 275 | TOnBlurAsync, |
| 276 | TOnSubmit, |
| 277 | TOnSubmitAsync, |
| 278 | TOnDynamic, |
| 279 | TOnDynamicAsync, |
| 280 | TOnServer, |
| 281 | TSubmitMeta |
| 282 | > |
| 283 | >, |
| 284 | ): AppFieldExtendedSolidFormApi< |
| 285 | TFormData, |
| 286 | TOnMount, |
| 287 | TOnChange, |
| 288 | TOnChangeAsync, |
| 289 | TOnBlur, |
| 290 | TOnBlurAsync, |
| 291 | TOnSubmit, |
| 292 | TOnSubmitAsync, |
| 293 | TOnDynamic, |
| 294 | TOnDynamicAsync, |
| 295 | TOnServer, |
| 296 | TSubmitMeta, |
| 297 | TComponents, |
| 298 | TFormComponents |
| 299 | > { |
| 300 | const form = createForm(props) |
| 301 | |
| 302 | const AppForm = ((formProps) => { |
| 303 | return ( |
| 304 | <opts.formContext.Provider value={form}> |
| 305 | {formProps.children} |
| 306 | </opts.formContext.Provider> |
| 307 | ) |
no outgoing calls
no test coverage detected