Skip to content

Commit 1f44c02

Browse files
committed
updates
1 parent bfab84b commit 1f44c02

File tree

4 files changed

+23
-26
lines changed

4 files changed

+23
-26
lines changed

apps/client/package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,32 @@
1010
},
1111
"dependencies": {
1212
"@graphql-yoga/subscription": "^5.0.5",
13-
"@hookform/resolvers": "^3.9.0",
13+
"@hookform/resolvers": "^5.2.2",
1414
"@tailwindcss/vite": "^4.1.16",
1515
"@tanstack/react-query": "^5.90.5",
1616
"@tanstack/react-query-devtools": "^5.90.2",
1717
"@tanstack/react-router": "^1.133.25",
1818
"@tanstack/react-router-devtools": "^1.133.25",
1919
"@trpc/client": "^11.6.0",
2020
"@trpc/tanstack-react-query": "^11.6.0",
21-
"@types/qrcode": "^1.5.0",
21+
"@types/qrcode": "^1.5.6",
2222
"color-parse": "^2.0.2",
2323
"daisyui": "^5.3.8",
24-
"formik": "^2.2.9",
25-
"qrcode": "^1.5.1",
24+
"formik": "^2.4.6",
25+
"qrcode": "^1.5.4",
2626
"react": "^19.2.0",
2727
"react-dom": "^19.2.0",
28-
"react-hook-form": "^7.53.0",
28+
"react-hook-form": "^7.65.0",
2929
"server": "workspace:*",
3030
"tailwind-merge": "^3.3.1",
3131
"tailwindcss": "^4.1.16",
32-
"use-breakpoint": "^3.0.3",
33-
"zod-formik-adapter": "^1.1.1"
32+
"use-breakpoint": "^4.0.10",
33+
"zod": "^4.1.12",
34+
"zod-formik-adapter": "^2.0.0"
3435
},
3536
"devDependencies": {
3637
"@tanstack/router-plugin": "^1.133.25",
37-
"@types/bun": "^1.3.0",
38+
"@types/bun": "^1.3.1",
3839
"@types/node": "^24.9.1",
3940
"@vitejs/plugin-react": "^5.0.4",
4041
"vite": "^7.1.12",
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
import { zodResolver } from "@hookform/resolvers/zod";
2-
import { type UseFormProps, useForm } from "react-hook-form";
3-
import type { z } from "zod";
2+
import { type FieldValues, type UseFormProps, useForm } from "react-hook-form";
3+
import type { $ZodType, input, output } from "zod/v4/core";
44

5-
export default function useZodForm<TSchema extends z.ZodType>(
6-
props: Omit<UseFormProps<TSchema["_input"]>, "resolver"> & {
7-
schema: TSchema;
8-
},
5+
export default function useZodForm<
6+
Input extends FieldValues,
7+
Output extends FieldValues,
8+
T extends $ZodType<Input, Output>,
9+
>(
10+
props: { schema: T } & Omit<
11+
UseFormProps<input<T>, unknown, output<T>>,
12+
"resolver"
13+
>,
914
) {
10-
const form = useForm<TSchema["_input"]>({
15+
const form = useForm<input<T>, unknown, output<T>>({
1116
...props,
1217
resolver: zodResolver(props.schema, undefined),
1318
});
1419

1520
return form;
16-
}
17-
18-
export type ZodSubmitHandler<TSchema extends z.ZodType> = (
19-
data: TSchema["_input"],
20-
event?: React.BaseSyntheticEvent,
21-
) => void | Promise<void>;
21+
}

apps/client/src/routes/join.$roomId.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,7 @@ export const Route = createFileRoute("/join/$roomId")({
1616

1717
const schema = z.object({
1818
email: z.string().email(),
19-
location: z.enum<UserLocation, readonly [UserLocation, ...UserLocation[]]>([
20-
"InPerson",
21-
"Online",
22-
"Proxy",
23-
]),
19+
location: z.enum(["InPerson", "Online", "Proxy"] as UserLocation[]),
2420
});
2521

2622
type FormValues = TypeOf<typeof schema>;

bun.lockb

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)