Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
62 views

I have the following schema in my RHF form: const latexSchema = z.string().refine( () => { return solutionRef.current?.editor?.state.doc.textContent.length! >= 10; }, 'Wymagane jest co ...
Korer's user avatar
  • 393
1 vote
1 answer
102 views

I have a React project using TypeScript, React Hook Form, and Zod. My Zod schema looks like this: import { z } from 'zod'; export const loyaltyNmvFormSchema = z.object({ maxPoint: z.coerce.number()....
Ali Ehyaie's user avatar
  • 1,334
-2 votes
1 answer
117 views

I have a vector3d object const vector3DBase = z .object({ x: z.number().nullable(), y: z.number().nullable(), z: z.number().nullable(), }) When added to a bigger schema export const ...
Todilo's user avatar
  • 1,331
0 votes
1 answer
68 views

I have a schema like this: const filterHomeworksSchema = z.object({ page: z.number(), pageSize: z.number(), search: z.string().optional(), sort: selectItem.nullable(), solutionFormats: ...
Korer's user avatar
  • 393
1 vote
1 answer
78 views

I’m using React Hook Form v7 with handleSubmit(onSubmit, onError). Here’s my form component: function CreateCabinForm() { const { register, handleSubmit, reset } = useForm(); function onSubmit(...
Muhammad Waleed's user avatar
1 vote
1 answer
40 views

I have a simple react-hook-form driven form that I'm conditionally validating with yup. I have a dropdown that, depending on the selected value, should change the required-ness of the following field. ...
Chuckatron's user avatar
-1 votes
2 answers
122 views

Context I’m using React Hook Form together with React Query. The parent component fetches data with a query, derives defaultValues, and passes them into the form. Parent component: export const ...
Andrey Rafalskyi's user avatar
1 vote
1 answer
633 views

I am using Shadcn Form which uses React-Hook-Form and Zod Resolver, The problem is when i submit the form by clicking the button while making the input incorrect for testing (Putting 1 char on 2 char ...
Prajil K's user avatar
  • 130
0 votes
1 answer
256 views

I’m trying to make a form, and it has never been this hard. I’ve never had a problem with this before, but right now it’s making me freak out. I have this very simple code: import { useForm } from &...
Felipe Gouvea's user avatar
0 votes
0 answers
102 views

Before there was an option to change the autogenerated id field name with keyName config (in useFieldArray). In the latest version it's not possible to set keyName to something else. My question is. ...
Ararat Harutyunyan's user avatar
0 votes
1 answer
100 views

My zod schema is: export const CourseSchema = z.object({ title: requiredString.max(100, { error: 'The title must not be longer than 100 characters!' }), briefDescription: requiredString.max(200, { ...
Ustin Drazhin's user avatar
1 vote
1 answer
112 views

I'm trying to use @mui/x-date-pickers: "^8.3.1 DatePicker component in a form with react-hook-form: "^7.62.0" Using some workarounds, I managed to give errors on blur and on submit, but ...
ZEN's user avatar
  • 1
1 vote
1 answer
101 views

I'm using React Hook Form along with useWatch and useEffect. I’m currently watching multiple fields using a single useWatch call: const [isRevolving, facilityGroup, facilities, payerGroupRates, ...
Andrey Rafalskyi's user avatar
0 votes
1 answer
223 views

I'm using react-hook-form with yup for validation and type inference (InferType). I have a required nested object in the schema, but I'm not setting default values for it at form initialization (...
Andrey Rafalskyi's user avatar
0 votes
1 answer
79 views

Currently I'm working in a component that has two children, each children has their specific components and their own form, the structure of the data is similar. I'm using react js with hook form to ...
GeekDev's user avatar
  • 450
2 votes
2 answers
466 views

I'm encountering a problem while using React Hook Form with Yup for validation. I have a schema where some fields are optional, but I'm getting a type error related to the resolver. Here's my Yup ...
444chak's user avatar
  • 21
2 votes
1 answer
517 views

I am facing a type mismatch issue while using "zod" schema with useForm of "react-hook-form". Resolver showing error for type mismatch. I set default value and not optional but ...
CrackerKSR's user avatar
  • 2,028
2 votes
0 answers
134 views

I'm using React Hook Form with Zod in a Next.js project, and I'm trying to validate a nested repetition field based on the selected repetition_type. My problem is: Validation runs immediately when ...
Nardin SY's user avatar
0 votes
0 answers
78 views

I am new to react-hook-form. My form schema is described below: My name property is required. But, when I use spread syntax to create data as a payload to send to server, TypeScript always says that ...
ATTzz's user avatar
  • 1
0 votes
1 answer
113 views

I have react-hook-form and zod/v4 for forms. I define zod validation object, and pass it as resolver to useForm. zod marks all fields as required by default and could mark them as optional. I need to ...
Mike Kokadii's user avatar
0 votes
1 answer
101 views

Using react-hook-form and try to be typescript compliant. I have a type: export type Vector3D = { x: number; y: number; z: number; }; And my reusable component function Vector3DComponent({ lens ...
Todilo's user avatar
  • 1,331
0 votes
0 answers
37 views

Description: I have a form with two separate useFieldArray sections (System Users and Board Members). When I add a new row to one field array after entering data in the other, the previously entered ...
J_Max's user avatar
  • 35
0 votes
2 answers
61 views

I'm using react-datepicker inside a Controller from react-hook-form. The component works, but I'm seeing a strange issue: Every time I interact with the DatePicker (e.g., select a date), the component ...
Itay Tur's user avatar
  • 1,972
0 votes
1 answer
57 views

React Hook Form Select Not Showing Pre-selected Value When Editing I have a React form using React Hook Form and shadcn/ui Select components. When I click "Edit" on a table row to edit a ...
J_Max's user avatar
  • 35
1 vote
0 answers
150 views

I am creating a form using react-hook-form, zod and @hookform/resolvers. I want a single form where the user can select an option and, based on the option, different values are required. Here are my ...
MWB's user avatar
  • 1,899
0 votes
1 answer
59 views

<Controller name={name} control={control} rules={ { validate: (value) => { if (rules.required) { ...
Aman Verma's user avatar
1 vote
0 answers
154 views

I'm building a form with react-hook-form that includes a useFieldArray for system users, displayed in a TanStack Table. While I can add new users, I can't edit the "Employee Name" and "...
J_Max's user avatar
  • 35
0 votes
0 answers
350 views

I’m using React Hook Form (RHF) for form handling and Yup for validation in my React app. I have a dynamic list of rows, each containing an Autocomplete component from Material-UI (MUI), along with ...
Harsh Pipaliya's user avatar
0 votes
0 answers
98 views

Trying to integrate React Hook Form and Zod in a react native project by applying validation rules using Zod to a signup form, but when I press the button, Zod isn't triggered to show any errors, even ...
Aly Mohamed's user avatar
1 vote
1 answer
96 views

I'm building a reusable form component in React that supports both: Simple (single-step) forms, and Multi-step forms (each step has its own schema and inputs). I'm using: react-hook-form Zod for ...
Pavitar Sharma's user avatar
0 votes
1 answer
54 views

I'm building a NextJS15 Form with useForm() hook and Zod validation that includes a file Input. Unfortunately, when I try to submit the form, Zod considers the uploaded file as a String (C:\FakePath\...
Lucas Mahé-Boisneau's user avatar
0 votes
0 answers
50 views

I'm implementing a form with react-hook-form and useFieldArray where users can add multiple account sets (cash account + trade account + currency) and set one as default using a toggle switch. However,...
J_Max's user avatar
  • 35
1 vote
1 answer
81 views

<Controller name='acknowledged_by_nurse' control={control} render={({ field, fieldState }) => ( <Button label="...
Jurie Pedrogas's user avatar
0 votes
0 answers
134 views

I'm using React Hook Form with a field array for phone numbers, and Zod for validation. When the form is submitted and the array is empty, my Zod schema returns an error like: { "phoneNumbers&...
suravshrestha's user avatar
0 votes
1 answer
114 views

The browser shows me blank page and I see no error in the VS Code and terminal, but in the console, I see: "Uncaught Error: Too many re-renders. React limits the number of renders to prevent an ...
Mahdyar's user avatar
1 vote
1 answer
51 views

The component uses react-hook-form for a two-step form (email then password). After submitting the email address in the first step, the email value appears to be reset to undefined. This prevents the ...
Nagy Dániel's user avatar
0 votes
1 answer
460 views

I'm using react-hook-form with a shadcn wrapper, and usually it works well. But in this particular component, I get this error on runtime, that useFormContext is null in my shadcn coponent. <Form {....
Eino Gourdin's user avatar
  • 4,686
3 votes
1 answer
4k views

I am trying to use react-hook-form in my nextjs component with shadcnUI Form. But the error that I am having is : Export useForm doesn't exist in target module 23 | FormMessage, 24 | } from "@/...
Fakhrul Islam Fuad's user avatar
0 votes
1 answer
181 views

Is it possible to validate a form before sending it to the client using RHF error states when submitting a form like this? const { control } = useForm<Tenant>({ defaultValues: { name: '...
Joshua Bolk's user avatar
1 vote
1 answer
124 views

I have a form built with react-hook-form. It looks like this: export default function PersonForm({ ref, mutation, defaultValues = formDefaultValues, }: { ref: RefObject<...
Leff's user avatar
  • 1,610
0 votes
1 answer
180 views

I am struggling creating a dynamic form with react-hook-form's useFieldArry, that appends a new field/input whenever the last field element gets non-empty (so that the user do not have to care about ...
Yannic's user avatar
  • 838
1 vote
2 answers
74 views

I'm building a multi-step form using React Hook Form and Zod for validation. Each step of the form has its own fields and a "Next" button to go to the next section. Here's what I want to ...
Linh Tran's user avatar
0 votes
1 answer
55 views

I'm working on a form in React using Material UI (MUI) and react-hook-form, and I want to create a reusable TextField component that: Works with react-hook-form using the Controller. Supports ...
Noman Jutt's user avatar
0 votes
1 answer
50 views

I am using Next with react-hook-form to handle form This is my create useForm code: const { control, setError, setValue, handleSubmit, formState: { errors }, } = useForm({ ...
LXT's user avatar
  • 865
2 votes
1 answer
78 views

I am fetching tsmin, tsmax values from get api. I have defined a zod schema with gte validation. const tsmin = Number(getMinMechProp("tensilestrength")); const tsmax = Number(...
iiotian's user avatar
  • 23
0 votes
2 answers
929 views

I'm using react-hook-form with the latest version of yup, and I'm trying to implement dynamic validation that depends on a type field selected by the user. The validation schema is generated using yup....
Mediator's user avatar
  • 15.4k
0 votes
0 answers
69 views

Why I can't delete the data if its left alone? I'm having a hard time how can I debug this, I'm using react-hook-form and maximizing the use of useFieldArray. I already have the ability to add and ...
Stykgwar's user avatar
  • 795
0 votes
1 answer
141 views

I am creating a small list using React Hook Form with useFieldArray. I want to filter the list when the user types anything in the search field. However, the filtering is not working. Below is my code:...
user944513's user avatar
  • 12.8k
0 votes
0 answers
91 views

Is it possible to add custom keys to the Zod ctx.addIssue that can then be retrieved in the Form.formState.errors from react-hook-form? For example here I want to add "foo" as a custom entry:...
chitzui's user avatar
  • 4,138
1 vote
2 answers
137 views

There is a state that can take the values true or false. If state is true, the field is required, otherwise it is not. How to validate depending on the condition? I found an example: const [...
Александр Кос's user avatar

1
2 3 4 5
52