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
174 votes
19 answers
318k views

I am creating a page for user to update personal data with React-Hook-Form. Once paged is loaded, I use useEffect to fetch the user's current personal data and set them into default value of the form. ...
theedchen's user avatar
  • 2,104
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
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
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 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
2 votes
1 answer
519 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
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
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
2 votes
2 answers
467 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
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
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
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 vote
2 answers
2k views

I am making a react application using vite, react hook form (7.54.1) and zod (3.24.1) whose main function is a multi step form. Now in my form schemas, I need to customize the default zod messages ...
Shiladitya Thakur's user avatar
10 votes
14 answers
31k views

I am having an issue with Shadcn react library's Select component. It seems that "dynamically" generated SelectItem is causing an issue were they are not displayed in the SelectValue box ...
Yousi's user avatar
  • 1,213
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
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
94 votes
6 answers
88k views

I'm trying to do validations for my form in react. I chose "react-hook-form" library. But I'm constantly getting error "Path.split is not a function. Even after using the default ...
Pramod Kumar's user avatar
  • 1,191
67 votes
10 answers
195k views

Previously I used to write like this: <input className="form-control" name="productImage" type='file' onChange={handleImageUpload} ref={register({ required: true })} /> ...
Mehnaz Khan'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
0 votes
1 answer
461 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
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
6 votes
3 answers
5k views

I’m working with a form in ReactJS using react-hook-form and Zod for validation, along with ShadCN UI for components. I have a number input field that I want to validate as a number. However, I'm ...
GregUng's user avatar
  • 77
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
13 votes
3 answers
11k views

I upgraded the Ant Design version from 4 to 5 and replaced Moment with Day.js, then encountered this error. const { field, fieldState: { error }, } = useController({ name: name, control: ...
Hồ Hoàng Việt Tiến'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
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
2 answers
963 views

I'm using Zod with react-hook-form to validate a form where at least one of two fields (warehouses or clusters) must be provided. Both fields are optional arrays of strings. I'm using .refine to ...
Nikita Dmitriev's user avatar
48 votes
6 answers
94k views

Couldn't find a solution. I'm using react-hook-form and I want to disable the submit button when the forms are empty and enable as long as all forms have atleast something written in them. How would I ...
user avatar
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
25 votes
10 answers
48k views

I am rendering a custom component using the Controller of react-hook-form. If an error occurs when using register, focus is normal, but the Controller does not. I was able to find a way to handle an ...
extradeck's user avatar
  • 630
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
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
87 votes
6 answers
103k views

I am using react-hook-form in my project and I have 2 totally separate forms, but when I submit one of the forms and if some fields in the other form is required I can't submit the current form, check ...
webcoder's user avatar
  • 1,557
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
59 views

<Controller name={name} control={control} rules={ { validate: (value) => { if (rules.required) { ...
Aman Verma's user avatar
60 votes
8 answers
97k views

I am trying to use a custom Material UI Autocomplete component and connect it to react-hook-form. TLDR: Need to use Material UI Autocomplete with react-hook-form Controller without defaultValue My ...
Sabbin's user avatar
  • 2,463
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
62 votes
4 answers
121k views

I want to provide default values in the input field using react-hook-form. First I retrieve the user data from the API endpoint and then setting the state users to that user data. Then I pass the ...
Subrato Pattanaik's user avatar
0 votes
0 answers
351 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
67 votes
7 answers
86k views

Can you tell me that why I'm getting error "A component is changing an uncontrolled Autocomplete to be controlled. Elements should not switch from uncontrolled to controlled (or vice versa). ...
the_developer's user avatar
2 votes
1 answer
2k views

I have a schema like this: const schema = z.object({ name: z.string(), email: z.string() }) Later in the code, I want to validate just email. Is it possible to get somehow email schema like this: ...
Korer's user avatar
  • 393
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
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
34 votes
7 answers
56k views

import React, { useState } from "react"; import FileBase64 from "react-file-base64"; import { useDispatch } from "react-redux"; import { makeStyles } from "@material-...
arda ersoy's user avatar
24 votes
3 answers
65k views

I have an email input and i want to validate that the user entered a specific email "[email protected]" and if not to show specific error message "This email is not in our database". I ...
ReactDeveloper's user avatar

1
2 3 4 5
52