Skip to content

Commit

Permalink
docs: fix tanstack start demo (#1196)
Browse files Browse the repository at this point in the history
* docs: fix tanstack start demo

* ci: apply automated fixes and generate docs

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
  • Loading branch information
crutchcorn and autofix-ci[bot] authored Mar 1, 2025
1 parent 0e7b1e7 commit d5e06c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion examples/react/tanstack-start/app/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { createFileRoute } from '@tanstack/react-router'
import { mergeForm, useForm, useTransform } from '@tanstack/react-form'
import { useStore } from '@tanstack/react-store'
import { formOpts, getFormDataFromServer, handleForm } from '~/utils/form'
import { getFormDataFromServer, handleForm } from '~/utils/form'
import { formOpts } from '~/utils/form-isomorphic'

export const Route = createFileRoute('/')({
component: Home,
Expand Down
8 changes: 8 additions & 0 deletions examples/react/tanstack-start/app/utils/form-isomorphic.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { formOptions } from '@tanstack/react-form'

export const formOpts = formOptions({
defaultValues: {
firstName: '',
age: 0,
},
})
9 changes: 1 addition & 8 deletions examples/react/tanstack-start/app/utils/form.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
import { createServerFn } from '@tanstack/react-start'
import { formOptions } from '@tanstack/react-form'
import {
ServerValidateError,
createServerValidate,
getFormData,
} from '@tanstack/react-form/start'
import { setResponseStatus } from '@tanstack/react-start/server'

export const formOpts = formOptions({
defaultValues: {
firstName: '',
age: 0,
},
})
import { formOpts } from './form-isomorphic'

const serverValidate = createServerValidate({
...formOpts,
Expand Down

0 comments on commit d5e06c7

Please sign in to comment.