File tree 3 files changed +11
-9
lines changed
examples/react/tanstack-start/app
3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change 1
1
import { createFileRoute } from '@tanstack/react-router'
2
2
import { mergeForm , useForm , useTransform } from '@tanstack/react-form'
3
3
import { useStore } from '@tanstack/react-store'
4
- import { formOpts , getFormDataFromServer , handleForm } from '~/utils/form'
4
+ import { getFormDataFromServer , handleForm } from '~/utils/form'
5
+ import { formOpts } from '~/utils/form-isomorphic'
5
6
6
7
export const Route = createFileRoute ( '/' ) ( {
7
8
component : Home ,
Original file line number Diff line number Diff line change
1
+ import { formOptions } from '@tanstack/react-form'
2
+
3
+ export const formOpts = formOptions ( {
4
+ defaultValues : {
5
+ firstName : '' ,
6
+ age : 0 ,
7
+ } ,
8
+ } )
Original file line number Diff line number Diff line change 1
1
import { createServerFn } from '@tanstack/react-start'
2
- import { formOptions } from '@tanstack/react-form'
3
2
import {
4
3
ServerValidateError ,
5
4
createServerValidate ,
6
5
getFormData ,
7
6
} from '@tanstack/react-form/start'
8
7
import { setResponseStatus } from '@tanstack/react-start/server'
9
-
10
- export const formOpts = formOptions ( {
11
- defaultValues : {
12
- firstName : '' ,
13
- age : 0 ,
14
- } ,
15
- } )
8
+ import { formOpts } from './form-isomorphic'
16
9
17
10
const serverValidate = createServerValidate ( {
18
11
...formOpts ,
You can’t perform that action at this time.
0 commit comments