mirror of
https://github.com/langgenius/dify.git
synced 2025-07-22 00:50:30 +00:00
22 lines
606 B
TypeScript
22 lines
606 B
TypeScript
![]() |
import { createFormHook, createFormHookContexts } from '@tanstack/react-form'
|
||
|
import TextField from './components/text-field'
|
||
|
import CheckboxField from './components/checkbox-field'
|
||
|
import SelectField from './components/select-filed'
|
||
|
import SubmitButton from './components/submit-button'
|
||
|
|
||
|
export const { fieldContext, useFieldContext, formContext, useFormContext }
|
||
|
= createFormHookContexts()
|
||
|
|
||
|
export const { useAppForm, withForm } = createFormHook({
|
||
|
fieldComponents: {
|
||
|
TextField,
|
||
|
CheckboxField,
|
||
|
SelectField,
|
||
|
},
|
||
|
formComponents: {
|
||
|
SubmitButton,
|
||
|
},
|
||
|
fieldContext,
|
||
|
formContext,
|
||
|
})
|