React Hook Form - Controller

React Hook Form - Controller

Beier Luo

3 года назад

96,717 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@hesamalavi9
@hesamalavi9 - 30.10.2021 05:17

Hey Bill, thanks for the video. A quick question, why do we need to spread the props in the Controller? What would happen if we don't (i.e. don't use the spread operator)?

Ответить
@fitzsimonsdev
@fitzsimonsdev - 30.10.2021 14:52

This is super cool. Thanks for showing off how this works. Complex forms can be so challenging. I really appreciate all the work you put in

Ответить
@FAHADJEE4
@FAHADJEE4 - 02.11.2021 23:19

Thanks for the great guide bill.

Ответить
@navya6340
@navya6340 - 09.01.2022 22:27

Just I have simple form with 5 text fields
With MUI 5 and React hook forms.

I created a component for text field in MUI 5 .

I want to write a controller for every field or in component level using useFormContext...

Which is the best practice...

Please give reply....

Please do one sample code in sandbox ..

Please...

Ответить
@Zullv
@Zullv - 14.01.2022 10:28

Why are you defining your own Controller instead of using the Controller component that already comes with the library? What's the point of the exercise?

Ответить
@coffeefps
@coffeefps - 18.01.2022 15:43

50fps is pretty weird, sometimes it's smooth, sometimes not. Regardless, very informative video.

Ответить
@WweRoman929
@WweRoman929 - 27.01.2022 08:19

I am using react table with react hook forms. If, I have 100 records but if I try to update single field using index its updating 100 records (we are using onBlur on each fields). I want to update only single field and after entering 100 records, I am facing performance issues.
Example:
<Table
columns={Columns}
data={fields}
updateMyData={updateMyData}

/>

please give any example

Ответить
@saraseado3729
@saraseado3729 - 19.02.2022 17:30

Hey Bill, what is the use of field.onChange() in the docs it says "A function which sends the input's value to the library. It should be assigned to the onChange prop of the input." what is the library? and also can I set a custom onChange() ? what I am trying to do is modify a value according to another registered value. I tried doing this:

<Controller
render={({ field }) => (
<Select
style={{ width: "100%" }}
{...field}
onChange={(e) => handleChange(e)}
>
{children}
</Select>
)}
name={name}
control={control}
/>

but it doesn't work

Ответить
@malakov5
@malakov5 - 23.02.2022 15:22

Really appreciate the videos and documentation you have around react-hook-form. It’s legendary. I’m glad I used it in my last project.

Ответить
@star24k
@star24k - 08.04.2022 01:13

Hi, Could you please create a video on useController. I am unable to find any tutorial/video on it. or creating reusable component(mui) with useController and validation. ty

Ответить
@DeViLTh0rn
@DeViLTh0rn - 23.05.2022 20:04

Hi Bill, i really hope u reply this.. im facing an issue the data from onSubmit return empty object.. im using MUI, and each custom textfield, autocomplete etc ill make sure they are connected with control from useFormContext.. and i also double check my form was wrap with FormProvider and pass all methods from useForm.. talking about useForm hook, i also provide the defaultValue and resolver.. so my question, in your experience, what the causes submit will return the empty object..

Ответить
@brahimo4701
@brahimo4701 - 02.06.2022 17:06

This is amazing, Thanks fo this amzing library

Ответить
@motehpro
@motehpro - 12.10.2022 14:53

Great video, thanks for library :)

Ответить
@cjambrosi
@cjambrosi - 08.12.2022 19:18

How to use setValue with Controller

Ответить
@workflowinmind
@workflowinmind - 08.02.2023 21:58

Came here from the doc, but you are reimplementing the builtin controller here right?

Ответить
@codinginflow
@codinginflow - 08.03.2023 19:00

If my input component has some weird onChange argument signature, is Controller the only way to get the input into RHF?

Ответить
@GOKU-fn4he
@GOKU-fn4he - 25.09.2023 16:02

Hey I am using rhf with yup. Now I make input components using controller and useFormContext and use that component using FormProvider. Now I want some validation in component level and some validation in page level. So How can I do that.? And I am using mantine UI.

Ответить
@raphael.portela
@raphael.portela - 16.02.2024 14:13

can you do an example of a complex form that has update and a lot of select values that comes from gql quries? im really lost, im using controller but i think i need something more

Ответить
@calvinwilliams729
@calvinwilliams729 - 15.04.2024 12:38

It is very helpful but this is advance video

Ответить
- 05.07.2024 18:54

Pertect

Ответить
@tomasburian6550
@tomasburian6550 - 27.09.2024 11:50

Do you guys have a guide for other types of inputs? It's quite frustrating everyone just shows a simple text field while the most of us in the field have to deal with selects and others. I'm having problems with using Controller with MUI components and there's little to go on.

Ответить