Skip to content

Commit 7630874

Browse files
committed
docs: update docs and examples
1 parent 2f50f7b commit 7630874

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

docs/framework/react/guides/ssr.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Let's start by creating a `formOption` that we'll use to share the form's shape
2626

2727
```typescript
2828
// app/routes/index.tsx, but can be extracted to any other path
29-
import { formOptions } from '@tanstack/react-form'
29+
import { formOptions } from '@tanstack/react-form-start'
3030

3131
// You can pass other form options here
3232
export const formOpts = formOptions({
@@ -44,7 +44,7 @@ Next, we can create [a Start Server Function](https://tanstack.com/start/latest/
4444
import {
4545
createServerValidate,
4646
ServerValidateError,
47-
} from '@tanstack/react-form/start'
47+
} from '@tanstack/react-form-start'
4848

4949
const serverValidate = createServerValidate({
5050
...formOpts,
@@ -93,7 +93,7 @@ Then we need to establish a way to grab the form data from `serverValidate`'s `r
9393

9494
```typescript
9595
// app/routes/index.tsx, but can be extracted to any other path
96-
import { getFormData } from '@tanstack/react-form/start'
96+
import { getFormData } from '@tanstack/react-form-start'
9797

9898
export const getFormDataFromServer = createServerFn({ method: 'GET' }).handler(
9999
async () => {
@@ -106,13 +106,13 @@ Finally, we'll use `getFormDataFromServer` in our loader to get the state from o
106106

107107
```tsx
108108
// app/routes/index.tsx
109-
import { createFileRoute } from '@tanstack/react-router'
110109
import {
110+
createFileRoute
111111
mergeForm,
112112
useForm,
113113
useStore,
114114
useTransform,
115-
} from '@tanstack/react-form'
115+
} from '@tanstack/react-form-start'
116116

117117
export const Route = createFileRoute('/')({
118118
component: Home,
@@ -192,7 +192,7 @@ Let's start by creating a `formOption` that we'll use to share the form's shape
192192
```typescript
193193
// shared-code.ts
194194
// Notice the import path is different from the client
195-
import { formOptions } from '@tanstack/react-form/nextjs'
195+
import { formOptions } from '@tanstack/react-form-nextjs'
196196

197197
// You can pass other form options here
198198
export const formOpts = formOptions({
@@ -213,7 +213,7 @@ Next, we can create [a React Server Action](https://playfulprogramming.com/posts
213213
import {
214214
ServerValidateError,
215215
createServerValidate,
216-
} from '@tanstack/react-form/nextjs'
216+
} from '@tanstack/react-form-nextjs'
217217
import { formOpts } from './shared-code'
218218

219219
// Create the server action that will infer the types of the form from `formOpts`
@@ -255,14 +255,13 @@ Finally, we'll use `someAction` in our client-side form component.
255255
'use client'
256256

257257
import { useActionState } from 'react'
258-
import { initialFormState } from '@tanstack/react-form/nextjs'
259-
// Notice the import is from `react-form`, not `react-form/nextjs`
260258
import {
259+
initialFormState
261260
mergeForm,
262261
useForm,
263262
useStore,
264263
useTransform,
265-
} from '@tanstack/react-form'
264+
} from '@tanstack/react-form-nextjs'
266265
import someAction from './action'
267266
import { formOpts } from './shared-code'
268267

@@ -347,7 +346,7 @@ Let's start by creating a `formOption` that we'll use to share the form's shape
347346
348347
```typescript
349348
// routes/_index/route.tsx
350-
import { formOptions } from '@tanstack/react-form/remix'
349+
import { formOptions } from '@tanstack/react-form-remix'
351350
352351
// You can pass other form options here
353352
export const formOpts = formOptions({
@@ -367,7 +366,7 @@ import {
367366
ServerValidateError,
368367
createServerValidate,
369368
formOptions,
370-
} from '@tanstack/react-form/remix'
369+
} from '@tanstack/react-form-remix'
371370

372371
import type { ActionFunctionArgs } from '@remix-run/node'
373372

@@ -410,10 +409,10 @@ Finally, the `action` will be called when the form submits.
410409

411410
```tsx
412411
// routes/_index/route.tsx
413-
import { Form, useActionData } from '@remix-run/react'
414-
415412
import {
413+
Form,
416414
mergeForm,
415+
useActionData
417416
useForm,
418417
useStore,
419418
useTransform,

examples/react/next-server-actions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"_test:types": "tsc"
99
},
1010
"dependencies": {
11-
"@tanstack/react-form": "^1.23.6",
11+
"@tanstack/react-form-nextjs": "^1.23.6",
1212
"@tanstack/react-store": "^0.7.7",
1313
"next": "15.5.3",
1414
"react": "^19.0.0",

examples/react/remix/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"@remix-run/node": "^2.17.1",
1212
"@remix-run/react": "^2.17.1",
1313
"@remix-run/serve": "^2.17.1",
14-
"@tanstack/react-form": "^1.23.6",
14+
"@tanstack/react-form-remix": "^1.23.6",
1515
"@tanstack/react-store": "^0.7.7",
1616
"isbot": "^5.1.30",
1717
"react": "^19.0.0",

examples/react/tanstack-start/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"dependencies": {
1212
"@tanstack/react-devtools": "^0.7.0",
13-
"@tanstack/react-form": "^1.23.6",
13+
"@tanstack/react-form-start": "^1.23.6",
1414
"@tanstack/react-form-devtools": "^0.1.6",
1515
"@tanstack/react-router": "^1.132.6",
1616
"@tanstack/react-start": "^1.132.32",

0 commit comments

Comments
 (0)