Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cruel-clubs-agree.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tanstack/react-form': minor
---

Update Start to Release Candidate version
4 changes: 2 additions & 2 deletions examples/react/tanstack-start/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"@tanstack/react-devtools": "^0.7.0",
"@tanstack/react-form": "^1.23.4",
"@tanstack/react-form-devtools": "^0.1.4",
"@tanstack/react-router": "^1.131.50",
"@tanstack/react-start": "^1.131.50",
"@tanstack/react-router": "^1.132.6",
"@tanstack/react-start": "^1.132.32",
"@tanstack/react-store": "^0.7.7",
"react": "^19.0.0",
"react-dom": "^19.0.0"
Expand Down
8 changes: 8 additions & 0 deletions examples/react/tanstack-start/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,11 @@ const rootRouteChildren: RootRouteChildren = {
export const routeTree = rootRouteImport
._addFileChildren(rootRouteChildren)
._addFileTypes<FileRouteTypes>()

import type { getRouter } from './router.tsx'
import type { createStart } from '@tanstack/react-start'
declare module '@tanstack/react-start' {
interface Register {
router: Awaited<ReturnType<typeof getRouter>>
}
}
4 changes: 2 additions & 2 deletions examples/react/tanstack-start/src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createRouter as createTanStackRouter } from '@tanstack/react-router'
import { routeTree } from './routeTree.gen'

export function createRouter() {
export function getRouter() {
const router = createTanStackRouter({
routeTree,
defaultPreload: 'intent',
Expand All @@ -13,6 +13,6 @@ export function createRouter() {

declare module '@tanstack/react-router' {
interface Register {
router: ReturnType<typeof createRouter>
router: ReturnType<typeof getRouter>
}
}
7 changes: 2 additions & 5 deletions examples/react/tanstack-start/src/utils/form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ const serverValidate = createServerValidate({
},
})

export const handleForm = createServerFn({
method: 'POST',
response: 'raw',
})
.validator((data: unknown) => {
export const handleForm = createServerFn({ method: 'POST' })
.inputValidator((data: unknown) => {
if (!(data instanceof FormData)) {
throw new Error('Invalid form data')
}
Expand Down
Empty file.
35 changes: 35 additions & 0 deletions packages/react-form-nextjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<img src="https://static.scarf.sh/a.png?x-pxid=be2d8a11-9712-4c1d-9963-580b2d4fb133" />

![TanStack Form Header](https://github.com/TanStack/form/raw/main/media/repo-header.png)

Hooks for managing form state in React

<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent">
<img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack">
</a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
<img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" />
</a><a href="https://github.com/TanStack/form/actions?query=workflow%3A%22react-form+tests%22">
<img src="https://github.com/TanStack/form/workflows/react-form%20tests/badge.svg" />
</a><a href="https://www.npmjs.com/package/@tanstack/form-core" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/form-core.svg" />
</a><a href="https://bundlephobia.com/package/@tanstack/react-form@latest" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-form" />
</a><a href="#badge">
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a><a href="https://github.com/TanStack/form/discussions">
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
</a><a href="https://bestofjs.org/projects/tanstack-form"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=TanStack%form%26since=daily" /></a><a href="https://github.com/TanStack/form/" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/TanStack/form.svg?style=social&label=Star" />
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow" />
</a> <a href="https://gitpod.io/from-referrer/">
<img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"/>
</a>

Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger)

## Visit [tanstack.com/form](https://tanstack.com/form) for docs, guides, API and more!

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

<!-- Use the force, Luke -->
25 changes: 25 additions & 0 deletions packages/react-form-nextjs/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @ts-check

import pluginReact from '@eslint-react/eslint-plugin'
import reactCompiler from 'eslint-plugin-react-compiler'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import rootConfig from '../../eslint.config.js'

export default [
...rootConfig,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
plugins: {
'react-hooks': pluginReactHooks,
'react-compiler': reactCompiler,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-compiler/react-compiler': 'error',
},
},
]
72 changes: 72 additions & 0 deletions packages/react-form-nextjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"name": "@tanstack/react-form-nextjs",
"version": "1.23.4",
"description": "Powerful, type-safe forms for React.",
"author": "tannerlinsley",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/TanStack/form.git",
"directory": "packages/react-form-nextjs"
},
"homepage": "https://tanstack.com/form",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"scripts": {
"clean": "premove ./dist ./coverage",
"test:eslint": "eslint ./src ./tests",
"test:types": "pnpm run \"/^test:types:ts[0-9]{2}$/\"",
"test:types:ts54": "node ../../node_modules/typescript54/lib/tsc.js",
"test:types:ts55": "node ../../node_modules/typescript55/lib/tsc.js",
"test:types:ts56": "node ../../node_modules/typescript56/lib/tsc.js",
"test:types:ts57": "node ../../node_modules/typescript57/lib/tsc.js",
"test:types:ts58": "tsc",
"test:lib": "vitest",
"test:lib:dev": "pnpm run test:lib --watch",
"test:build": "publint --strict",
"build": "vite build"
},
"type": "module",
"types": "dist/esm/index.d.ts",
"module": "dist/esm/index.js",
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"./package.json": "./package.json"
},
"sideEffects": false,
"files": [
"dist",
"src"
],
"dependencies": {
"@tanstack/react-form": "workspace:*",
"decode-formdata": "^0.9.0",
"devalue": "^5.3.2"
},
"devDependencies": {
"@tanstack/react-start": "^1.132.32",
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@vitejs/plugin-react": "^4.7.0",
"eslint-plugin-react-compiler": "19.1.0-rc.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"vite": "^7.1.6"
},
"peerDependencies": {
"@tanstack/react-start": "^1.132.32",
"react": "^17.0.0 || ^18.0.0 || ^19.0.0"
},
"peerDependenciesMeta": {
"@tanstack/react-start": {
"optional": true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {
FormValidateOrFn,
UnwrapFormAsyncValidateOrFn,
} from '@tanstack/form-core'
import type { ServerFormState } from './types'
import type { ServerFormState } from '@tanstack/react-form'

interface CreateServerValidateOptions<
TFormData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { ServerFormState } from './types'
import type { FormAsyncValidateOrFn } from '@tanstack/form-core'
import type { ServerFormState } from '@tanstack/react-form'

interface ServerValidateErrorState<
TFormData,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from '@tanstack/form-core'
export * from '@tanstack/react-form'

export * from './createServerValidate'
export * from './error'
export * from './types'
6 changes: 6 additions & 0 deletions packages/react-form-nextjs/tests/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import '@testing-library/jest-dom/vitest'
import { cleanup } from '@testing-library/react'
import { afterEach } from 'vitest'

// https://testing-library.com/docs/react-testing-library/api#cleanup
afterEach(() => cleanup())
5 changes: 5 additions & 0 deletions packages/react-form-nextjs/tests/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export function sleep(timeout: number): Promise<void> {
return new Promise((resolve, _reject) => {
setTimeout(resolve, timeout)
})
}
9 changes: 9 additions & 0 deletions packages/react-form-nextjs/tsconfig.docs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"paths": {
"@tanstack/form-core": ["../form-core/src"]
}
},
"exclude": ["tests", "eslint.config.js", "vite.config.ts"]
}
12 changes: 12 additions & 0 deletions packages/react-form-nextjs/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"paths": {
"@tanstack/form-core": ["../form-core/src"],
"@tanstack/react-form": ["../react-form/dist/esm"]
}
},
"include": ["src", "tests", "eslint.config.js", "vite.config.ts"]
}
26 changes: 26 additions & 0 deletions packages/react-form-nextjs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineConfig, mergeConfig } from 'vitest/config'
import { tanstackViteConfig } from '@tanstack/config/vite'
import react from '@vitejs/plugin-react'
import packageJson from './package.json'

const config = defineConfig({
plugins: [react()],
test: {
name: packageJson.name,
dir: './tests',
watch: false,
environment: 'jsdom',
setupFiles: ['./tests/test-setup.ts'],
coverage: { enabled: true, provider: 'istanbul', include: ['src/**/*'] },
typecheck: { enabled: true },
},
})

export default mergeConfig(
config,
tanstackViteConfig({
entry: ['./src/index.ts'],
cjs: false,
srcDir: './src',
}),
)
Empty file.
35 changes: 35 additions & 0 deletions packages/react-form-remix/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<img src="https://static.scarf.sh/a.png?x-pxid=be2d8a11-9712-4c1d-9963-580b2d4fb133" />

![TanStack Form Header](https://github.com/TanStack/form/raw/main/media/repo-header.png)

Hooks for managing form state in React

<a href="https://twitter.com/intent/tweet?button_hashtag=TanStack" target="\_parent">
<img alt="#TanStack" src="https://img.shields.io/twitter/url?color=%2308a0e9&label=%23TanStack&style=social&url=https%3A%2F%2Ftwitter.com%2Fintent%2Ftweet%3Fbutton_hashtag%3DTanStack">
</a><a href="https://discord.com/invite/WrRKjPJ" target="\_parent">
<img alt="" src="https://img.shields.io/badge/Discord-TanStack-%235865F2" />
</a><a href="https://github.com/TanStack/form/actions?query=workflow%3A%22react-form+tests%22">
<img src="https://github.com/TanStack/form/workflows/react-form%20tests/badge.svg" />
</a><a href="https://www.npmjs.com/package/@tanstack/form-core" target="\_parent">
<img alt="" src="https://img.shields.io/npm/dm/@tanstack/form-core.svg" />
</a><a href="https://bundlephobia.com/package/@tanstack/react-form@latest" target="\_parent">
<img alt="" src="https://badgen.net/bundlephobia/minzip/@tanstack/react-form" />
</a><a href="#badge">
<img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
</a><a href="https://github.com/TanStack/form/discussions">
<img alt="Join the discussion on Github" src="https://img.shields.io/badge/Github%20Discussions%20%26%20Support-Chat%20now!-blue" />
</a><a href="https://bestofjs.org/projects/tanstack-form"><img alt="Best of JS" src="https://img.shields.io/endpoint?url=https://bestofjs-serverless.now.sh/api/project-badge?fullName=TanStack%form%26since=daily" /></a><a href="https://github.com/TanStack/form/" target="\_parent">
<img alt="" src="https://img.shields.io/github/stars/TanStack/form.svg?style=social&label=Star" />
</a><a href="https://twitter.com/tannerlinsley" target="\_parent">
<img alt="" src="https://img.shields.io/twitter/follow/tannerlinsley.svg?style=social&label=Follow" />
</a> <a href="https://gitpod.io/from-referrer/">
<img src="https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod" alt="Gitpod Ready-to-Code"/>
</a>

Enjoy this library? Try the entire [TanStack](https://tanstack.com)! [TanStack Table](https://github.com/TanStack/table), [TanStack Router](https://github.com/tanstack/router), [TanStack Virtual](https://github.com/tanstack/virtual), [React Charts](https://github.com/TanStack/react-charts), [React Ranger](https://github.com/TanStack/ranger)

## Visit [tanstack.com/form](https://tanstack.com/form) for docs, guides, API and more!

### [Become a Sponsor!](https://github.com/sponsors/tannerlinsley/)

<!-- Use the force, Luke -->
25 changes: 25 additions & 0 deletions packages/react-form-remix/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// @ts-check

import pluginReact from '@eslint-react/eslint-plugin'
import reactCompiler from 'eslint-plugin-react-compiler'
import pluginReactHooks from 'eslint-plugin-react-hooks'
import rootConfig from '../../eslint.config.js'

export default [
...rootConfig,
{
files: ['**/*.{ts,tsx}'],
...pluginReact.configs.recommended,
},
{
plugins: {
'react-hooks': pluginReactHooks,
'react-compiler': reactCompiler,
},
rules: {
'react-hooks/exhaustive-deps': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-compiler/react-compiler': 'error',
},
},
]
Loading