Compare commits
No commits in common. "c8fcdd7f29a4d644dc4b7bbefb46e4f66fddb46d" and "6326d0bc062447033caed09ac6a40df572746c42" have entirely different histories.
c8fcdd7f29
...
6326d0bc06
43
package-lock.json
generated
43
package-lock.json
generated
@ -29,7 +29,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.1.3",
|
"@biomejs/biome": "2.1.3",
|
||||||
"@tanstack/react-router-ssr-query": "^1.131.5",
|
|
||||||
"@types/react": "^19.1.9",
|
"@types/react": "^19.1.9",
|
||||||
"@types/react-dom": "^19.1.7",
|
"@types/react-dom": "^19.1.7",
|
||||||
"@vitejs/plugin-react": "^4.7.0",
|
"@vitejs/plugin-react": "^4.7.0",
|
||||||
@ -6996,30 +6995,6 @@
|
|||||||
"react-dom": ">=18.0.0 || >=19.0.0"
|
"react-dom": ">=18.0.0 || >=19.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tanstack/react-router-ssr-query": {
|
|
||||||
"version": "1.131.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tanstack/react-router-ssr-query/-/react-router-ssr-query-1.131.5.tgz",
|
|
||||||
"integrity": "sha512-fV0VkRvv8Dj44Ufyy4xJRf0ehddH5vVwhQ7BT1YNqz7eGTPiakflHkaqaGhI0Xv83hsuqneROmR+GFqT1RjIhA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"@tanstack/router-ssr-query-core": "1.131.5"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/tannerlinsley"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@tanstack/query-core": ">=5.66.0",
|
|
||||||
"@tanstack/react-query": ">=5.66.2",
|
|
||||||
"@tanstack/react-router": ">=1.127.0",
|
|
||||||
"react": ">=18.0.0 || >=19.0.0",
|
|
||||||
"react-dom": ">=18.0.0 || >=19.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@tanstack/react-router-with-query": {
|
"node_modules/@tanstack/react-router-with-query": {
|
||||||
"version": "1.130.12",
|
"version": "1.130.12",
|
||||||
"resolved": "https://registry.npmjs.org/@tanstack/react-router-with-query/-/react-router-with-query-1.130.12.tgz",
|
"resolved": "https://registry.npmjs.org/@tanstack/react-router-with-query/-/react-router-with-query-1.130.12.tgz",
|
||||||
@ -7328,24 +7303,6 @@
|
|||||||
"url": "https://github.com/sponsors/colinhacks"
|
"url": "https://github.com/sponsors/colinhacks"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@tanstack/router-ssr-query-core": {
|
|
||||||
"version": "1.131.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tanstack/router-ssr-query-core/-/router-ssr-query-core-1.131.5.tgz",
|
|
||||||
"integrity": "sha512-RNzeZrWZvdTCz/vzhwNw6sd453fdd8HyF8IWsZFCge+3C1JU/Nmc1PjqaMeGL5bxqbOXxhDJZhd2SIy8tyWcDg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"type": "github",
|
|
||||||
"url": "https://github.com/sponsors/tannerlinsley"
|
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"@tanstack/query-core": ">=5.66.0",
|
|
||||||
"@tanstack/router-core": ">=1.127.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@tanstack/router-utils": {
|
"node_modules/@tanstack/router-utils": {
|
||||||
"version": "1.130.12",
|
"version": "1.130.12",
|
||||||
"resolved": "https://registry.npmjs.org/@tanstack/router-utils/-/router-utils-1.130.12.tgz",
|
"resolved": "https://registry.npmjs.org/@tanstack/router-utils/-/router-utils-1.130.12.tgz",
|
||||||
|
|||||||
@ -35,7 +35,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@biomejs/biome": "2.1.3",
|
"@biomejs/biome": "2.1.3",
|
||||||
"@tanstack/react-router-ssr-query": "^1.131.5",
|
|
||||||
"@types/react": "^19.1.9",
|
"@types/react": "^19.1.9",
|
||||||
"@types/react-dom": "^19.1.7",
|
"@types/react-dom": "^19.1.7",
|
||||||
"@vitejs/plugin-react": "^4.7.0",
|
"@vitejs/plugin-react": "^4.7.0",
|
||||||
|
|||||||
@ -25,6 +25,8 @@ export const useValidation = <T,>({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
|
//FIXME: Flatten errors, new in zod v4
|
||||||
|
// setErrors(result.error.flatten().fieldErrors as T)
|
||||||
setErrors(z.flattenError(result.error).fieldErrors as T)
|
setErrors(z.flattenError(result.error).fieldErrors as T)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,31 +1,23 @@
|
|||||||
import { createRouter as createTanstackRouter } from "@tanstack/react-router"
|
import { createRouter as createTanstackRouter } from "@tanstack/react-router"
|
||||||
import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query"
|
import { routerWithQueryClient } from "@tanstack/react-router-with-query"
|
||||||
import { createQueryContext } from "./integrations/tanstack-query/context.tsx"
|
import { createQueryContext } from "./integrations/tanstack-query/context.tsx"
|
||||||
import { QueryProvider } from "./integrations/tanstack-query/provider.tsx"
|
import { QueryProvider } from "./integrations/tanstack-query/provider.tsx"
|
||||||
import { routeTree } from "./routeTree.gen.ts"
|
import { routeTree } from "./routeTree.gen.ts"
|
||||||
|
|
||||||
export const createRouter = () => {
|
export const createRouter = () => {
|
||||||
const { queryClient } = createQueryContext()
|
const rqContext = createQueryContext()
|
||||||
|
|
||||||
const router = createTanstackRouter({
|
return routerWithQueryClient(
|
||||||
|
createTanstackRouter({
|
||||||
routeTree,
|
routeTree,
|
||||||
context: { queryClient, user: null },
|
context: { ...rqContext, user: null },
|
||||||
defaultPreload: "intent",
|
defaultPreload: "intent",
|
||||||
Wrap: (props: { children: React.ReactNode }) => {
|
Wrap: (props: { children: React.ReactNode }) => {
|
||||||
return (
|
return <QueryProvider {...rqContext}>{props.children}</QueryProvider>
|
||||||
<QueryProvider {...{ queryClient }}>{props.children}</QueryProvider>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
})
|
}),
|
||||||
|
rqContext.queryClient
|
||||||
setupRouterSsrQueryIntegration({
|
)
|
||||||
router,
|
|
||||||
queryClient,
|
|
||||||
handleRedirects: true,
|
|
||||||
wrapQueryClient: false
|
|
||||||
})
|
|
||||||
|
|
||||||
return router
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module "@tanstack/react-router" {
|
declare module "@tanstack/react-router" {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user