-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
328e650
commit e186550
Showing
3 changed files
with
32 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { SubmitHandler, useForm } from "react-hook-form"; | ||
import { z } from "zod"; | ||
import { zodResolver } from "@hookform/resolvers/zod"; | ||
|
||
const formSchema = z.object({ | ||
id: z.string(), | ||
additionalInformation: z.string(), | ||
attachments: z.object({}), | ||
}); | ||
|
||
export type MedicaidFormSchema = z.infer<typeof formSchema>; | ||
|
||
export const MedicaidForm = () => { | ||
const { handleSubmit, register, formState } = useForm<MedicaidFormSchema>({ | ||
resolver: zodResolver(formSchema), | ||
}); | ||
|
||
const onSubmit: SubmitHandler<MedicaidFormSchema> = (data) => { | ||
console.log(data, formState.errors); | ||
}; | ||
|
||
return ( | ||
<form onSubmit={handleSubmit(onSubmit)}> | ||
<input {...register("id")} /> | ||
</form> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters