react-hook-form Questions

4

I have to use the react-password-checklist library to show the user if he is obeying the password rules declared in zod's schemaUser. However, I am not successful. obs: I'm using zod to validate th...
Scape asked 11/8, 2023 at 19:14

10

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 ...
Sinistrodextral asked 6/9, 2023 at 9:41

3

I have a resuable component, called DatePicker like this export interface IPDatePicker extends IProps { control: any label: string placeholder: string value?: string errorText?: string isRequ...
Wattage asked 6/4, 2022 at 4:51

6

I'm trying to use react-hook-form with multi-select and select but it is not working. It worked with normal text field but not with select and multiselect. Here's my code. Thank you so much. <d...
Modiolus asked 12/5, 2022 at 23:5

5

When using react-hook-form with Typescript, there is a component that sends some props, register being one of them. The issue is with its type when declared in an interface: export interface MyProp...

2

I am using react-select for better look on UI, and I have implemented it, Now what I am trying to do is I want to validate that input field when user clicks on Done button (form submit) I am using...

7

I'm creating a form which has a date field. I'm using MUI and react-hook-form for validation. I've tried to render the field in two different ways, but when submitting my form I'm not getting the e...
Amandaamandi asked 2/7, 2022 at 20:15

2

Solved

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 datab...
Taxable asked 17/1, 2023 at 14:56

8

I am using useFormContext in one the child component. this is the code for it: const { register } = useFormContext<CustomerProfileFormData>(); How can I Mock useFormContext so that I can tes...
Hexarchy asked 29/6, 2021 at 18:3

8

Solved

I'm using Next.js, TypeScript, sanity and tailwindcss. Im trying to use the react-hook-form but i receive an error. I've tried: changing the Post function to an arrow function changing the Post fu...
Janellajanelle asked 9/6, 2022 at 22:34

4

How can we know form is modified or not in react-hook-form. Anyone have idea. I want know if any of the value is changed and update the state edited to true. After i provide the defaultValue to use...
This asked 19/7, 2020 at 13:50

6

Solved

Basically what the title says. When I submit the form I'm checking if the login is successful, if not it displays a message. However, when the user starts to type I want this message to go away. Ki...
Olnton asked 18/9, 2020 at 9:56

10

Previously I used to write like this: <input className="form-control" name="productImage" type='file' onChange={handleImageUpload} ref={register({ required: true })} /> A...
Lauricelaurie asked 3/4, 2021 at 21:42

3

Solved

I'm using react-hook-form. I'm trying implemnet shopping cart with this library, but getting struggle with get number value. the input tag which name="count" always return string value even set typ...
Proteus asked 13/5, 2020 at 18:38

3

Solved

I'm working on a simple file upload form using react-hook-form and I need to validate that a file has been selected for upload. Using yup for validation. I realize there are other questions on this...
Wormy asked 19/2, 2022 at 21:53

2

Solved

I created a form with react-hook-form. It logs "fullName" and "city" correctly in the console, but not the radio buttons. With the radio buttons you get as result "null&quo...
Laoighis asked 20/5, 2021 at 19:14

3

Solved

When I try to make a blog, I can't pass the editor in the form. I found this: DraftJS React-Hook-Form - submitting Editor as input but it seems that LexicalRichTextEditor does not have such a tag t...
Caernarvonshire asked 10/1, 2023 at 5:55

5

Solved

I use react-hook-form with yup to validate my forms. I want to know all required fields of a schema to display some information in form (like '*' for required fields). We could achieve this with th...
Swerve asked 20/10, 2020 at 7:26

11

Solved

I've built a form in React using Material UI and React Hook Form. I'm trying to create a custom TextField element that works as a Select Input. I would like it to be an uncontrolled component with ...
Alonaalone asked 3/8, 2020 at 21:6

7

Solved

Is it possible to validate a field only when it exists? I'm going to create an application. A field(email) may / may not display on step 2, it depends on the step 1's selected option. The problem i...
Plangent asked 7/1, 2021 at 13:48

9

How do you implement set focus in an input using React-Hook-Form, this is what their FAQ's "How to share ref usage" code here https://www.react-hook-form.com/faqs/#Howtosharerefusage impo...
Eddieeddina asked 8/9, 2020 at 15:1

4

Solved

I'm using React Hook Form in order to validate some simple inputs : import React from "react"; import useForm from "react-hook-form"; import "./App.css"; function Ap...
Celadon asked 11/11, 2019 at 8:38

6

Solved

I'm using React Hook Form v7 and I'm trying to make my data form persistent on page reload. I read the official RHF documentation which suggests to use little state machine and I tried to implement...
Impeccable asked 17/3, 2022 at 11:59

5

Solved

I'm creating an auth form and I'm referencing the react-hook-form docs on how to use yup to validate my inputs. As far as I can tell, everything is pretty much identical to the implementation provi...
Hillard asked 21/9, 2021 at 15:47

16

Solved

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 fo...
Shoring asked 7/6, 2020 at 8:16

© 2022 - 2025 — McMap. All rights reserved.