Multi-Step form with react-hook-form

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 พ.ย. 2024

ความคิดเห็น • 71

  • @juliocesarbenavente9590
    @juliocesarbenavente9590 3 ปีที่แล้ว +17

    I can't believe it. You just saved me from being fired!

    • @AustinShelby
      @AustinShelby  3 ปีที่แล้ว

      Haha, how did that happen?

    • @Ricardoromero4444
      @Ricardoromero4444 3 ปีที่แล้ว +1

      ​@@AustinShelby He probably chose react-hook-form as the form library in their current project. Then the manager came and asked for a multi-step form and they got stuck.
      I don't feel that justifies firing anyone... but it's a possible scenario.

  • @manavshah7033
    @manavshah7033 3 ปีที่แล้ว +4

    this is THE PERFECT video I was searching on yt. Your words are straight and clear and fits right into the mind. No fast forward, no timepass, just a perfect tutorial.

  • @yerson557
    @yerson557 3 ปีที่แล้ว +3

    With the latest react-hook-version v7, you don't need to add CSS, values persist in the form even if you change the step. Thanks, Austin for your tutorial! it helps me a lot

    • @josehuamanvalqui5663
      @josehuamanvalqui5663 3 ปีที่แล้ว +1

      That works out of the box or you need to add some extra configuration?

    • @yerson557
      @yerson557 3 ปีที่แล้ว

      @@josehuamanvalqui5663 just be sure you use the latest version v7, you will notice that when you are coding specifically the section where Austin use CSS.

    • @phongtruongxuan7221
      @phongtruongxuan7221 3 ปีที่แล้ว

      @@yerson557 if it is an input checkbox, it will repeat the results in the previous section and I don't know how to solve it now?

  • @Ricardoromero4444
    @Ricardoromero4444 3 ปีที่แล้ว

    You can just pass the 'hidden' attribute to any html tag instead of passing a classname, resulting in cleaner syntax.
    Amazing video. Pretty smart and simple implementation.

  • @le_travie7724
    @le_travie7724 2 ปีที่แล้ว +1

    Very well done and extremely simple not too many third party libraries. Thank you this is what I was looking for

    • @AustinShelby
      @AustinShelby  2 ปีที่แล้ว

      Thanks for watching and I'm glad you found my teaching style helpful!

  • @ikwuegbuanthony6521
    @ikwuegbuanthony6521 3 ปีที่แล้ว

    The best I've seen so far. Thanks Austin.

  • @maungmaungtar9651
    @maungmaungtar9651 2 ปีที่แล้ว +1

    Amazing tutorial with simple and step by step explanations on complex, multi step form, Thank you Austin.

  • @RealEstate3D
    @RealEstate3D 3 ปีที่แล้ว +1

    This the for the old Version of react-hook-form v6. The same video with TypeScript + rhf v7 would have been a real gem as there isn’t one on TH-cam.

    • @AustinShelby
      @AustinShelby  3 ปีที่แล้ว +2

      That sounds like a good idea, maybe I'll make one

    • @Ricardoromero4444
      @Ricardoromero4444 3 ปีที่แล้ว

      @@AustinShelby Looking forward to it!

  • @cbijay
    @cbijay 2 ปีที่แล้ว

    Great multi step form tutorial. 👍👋❤️😍

  • @cristhianeresende5663
    @cristhianeresende5663 2 ปีที่แล้ว

    This really helped me! Thank you, Austin!

  • @jakeruth4603
    @jakeruth4603 3 ปีที่แล้ว +5

    You make great videos man! Currently learning NextJS with tailwind and I love what you're doing. Keep it up!

  • @bluebill1049
    @bluebill1049 3 ปีที่แล้ว +3

    Thanks for producing this awesome tutorial!

  • @solotalemwa
    @solotalemwa 3 ปีที่แล้ว +1

    Jusst awesome! You are a life saver Austin! I will definitely checkout your tailwind video. Thanks again.

    • @AustinShelby
      @AustinShelby  3 ปีที่แล้ว

      I'm glad you could learn something!

  • @cecetheworld
    @cecetheworld 3 ปีที่แล้ว +1

    This video was SO incredibly helpful - thanks so much for this! I really appreciate the pace and the way you explained each step in such a succinct, clear way. You just saved me from a couple hours of potential headache, so thank you!!!

    • @AustinShelby
      @AustinShelby  3 ปีที่แล้ว

      Awesome! Glad to hear that!

  • @alisequeira1619
    @alisequeira1619 3 ปีที่แล้ว

    Nice tutorial! pretty straightforward, now I'm gonna try to separate each step in different files

  • @mrastrogastro
    @mrastrogastro 2 ปีที่แล้ว

    Thank you Austin! Exactly what I needed! Clean explanation! Cheers man!

    • @AustinShelby
      @AustinShelby  2 ปีที่แล้ว

      Glad you learned something! Thanks for watching

  • @altairtodescatto
    @altairtodescatto 3 ปีที่แล้ว

    Nice, this just save me a lot of research on how to do it. thanks

  • @aleyrizvi
    @aleyrizvi 2 ปีที่แล้ว

    Love this video!
    Question: can we use yupResolver with this strategy?

  • @nickwoodward819
    @nickwoodward819 ปีที่แล้ว +1

    Only half way through but loving the video. Out of interest, do you need to use a ref to register the input? I've been using {...register('name', {required: true})} as an attribute and it seems to be working ok?

    • @AustinShelby
      @AustinShelby  ปีที่แล้ว +1

      Thank you for watching. When I recorded this video the latest version of react-hook-form was 6. Now it's in version 7 where the syntax has changed a little bit. The way you are using it now is correct 👍.

    • @nickwoodward819
      @nickwoodward819 ปีที่แล้ว +1

      @@AustinShelby Perfect, and thanks for the quick reply!

  • @benwasonga
    @benwasonga 3 ปีที่แล้ว

    this is exactly what I needed.
    Gracias

  • @mohamedali9249
    @mohamedali9249 ปีที่แล้ว

    thank a lot for thit tutorial, bro i have a question how will it be if you the sections in differents componet, i mean how will you acces to data in different form and submit them in a single, i'm really curious about knowing this

  • @em6663
    @em6663 2 ปีที่แล้ว

    great work man !

  • @sivansuh4612
    @sivansuh4612 2 ปีที่แล้ว

    Thank you dude , it's awesome

  • @braddeibert6268
    @braddeibert6268 2 ปีที่แล้ว

    Trying to process what hiding parts of the form means for accessibility. Seems like keyboard users would still have the entire form read to them, even though the whole form is not visible at once for sighted users. Thoughts?

  • @DavisNorde
    @DavisNorde 3 ปีที่แล้ว

    Thank you so much, Austin!

  • @kgetgamingentertainmenttec8243
    @kgetgamingentertainmenttec8243 2 ปีที่แล้ว +1

    Is there another way to hide the forms when we press next other than using tailwind css

  • @prathameshyerva248
    @prathameshyerva248 3 ปีที่แล้ว

    time savior !

  • @walaaemam6001
    @walaaemam6001 2 ปีที่แล้ว

    Thank You Sir

  • @jaggyjut
    @jaggyjut 3 ปีที่แล้ว

    Cool. What about adding logic between the forms?

  • @chinomsojohnson8746
    @chinomsojohnson8746 3 ปีที่แล้ว

    Thanks for this amazing tutorial.

  • @ahmaat19
    @ahmaat19 2 ปีที่แล้ว

    Thank you.

  • @airini18
    @airini18 2 ปีที่แล้ว

    It was awesome!! Thank you so much!
    Just one question, what does the "null, 2" mean?

    • @AustinShelby
      @AustinShelby  2 ปีที่แล้ว

      Thank you Irene for watching! JSON.stringify() takes 3 arguments. The object we want to stringify, a replacer function (we don't want this so we can just give null), and the amount of space for indentation for better readability. You can learn more here: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify

  • @ajcortess
    @ajcortess 2 ปีที่แล้ว

    Thanks bro!!!

    • @AustinShelby
      @AustinShelby  2 ปีที่แล้ว

      Thank you for watching Ale! I'm glad you learned something. :-)

  • @stefcioagoodboy
    @stefcioagoodboy 3 ปีที่แล้ว +1

    Would love to see the same video with TS + React Hook Form v7 + Material UI + Tailwind :)

  • @zlatkoiliev8927
    @zlatkoiliev8927 ปีที่แล้ว

    Nice tutorial mate. Can you do the same with Next.js and the next router. So each step of the form will be a new route?!?

    • @AustinShelby
      @AustinShelby  ปีที่แล้ว

      Hey Zlatko thanks for watching the video. That sounds like an interesting topic for a tutorial, I'll consider it

  • @nickwoodward819
    @nickwoodward819 ปีที่แล้ว

    Hi Austin, sorry for another question! When I move to the next step it seems to populate the next inputs with the previous values. Have you ever come across that behaviour?

  • @soultouchingsongs
    @soultouchingsongs 3 ปีที่แล้ว

    Excellent. Thanks a ton. Subscribed.

  • @phongtruongxuan7221
    @phongtruongxuan7221 3 ปีที่แล้ว

    If it's a series of multiple choice questions, how should we solve it?

  • @leandroalmeida1210
    @leandroalmeida1210 2 ปีที่แล้ว

    Muito bom!, conseguir entender e aplicar a um projeto real, mesmo sem ouvir o áudio ou ver as legenda, obrigado!

  • @abdelilahlahdili7168
    @abdelilahlahdili7168 3 ปีที่แล้ว

    Thank you so so so Much !!!!!

  • @mefju200
    @mefju200 2 ปีที่แล้ว

    Thanks for this tutorial! There is one inaccuracy though. When you play around with the forward and back buttons at some point the form gets submitted too early. When you go through all the steps and check the checkboxes then go back and then try to go to the next step again the form actually gets submitted. Any idea on how to solve this?

    • @walaaemam6001
      @walaaemam6001 2 ปีที่แล้ว

      Did you find the solution to the problem?

  • @phongtruongxuan7221
    @phongtruongxuan7221 3 ปีที่แล้ว

    I'm having a problem with taking a multiple choice test with multiple questions in sections and don't know how to solve it? can you help me with the solution?

  • @longsyee
    @longsyee 3 ปีที่แล้ว

    I think there is a v7 update change a lot =) can you redo a video to keep it easy to follow?

  • @waleedsharif618
    @waleedsharif618 3 ปีที่แล้ว

    Could you create this same thing using bootstrap or antd instead of tailwind ?

  • @marbot9780
    @marbot9780 3 ปีที่แล้ว

    Hi Austin,
    there is a big mistake in your code!
    If I jump from the 3rd step again to the 1st step - then afterwards the value in the 2nd step is missing!
    What is the reason for this?
    Best regards
    Markus

  • @miketepes8208
    @miketepes8208 ปีที่แล้ว

    This will work with zod? I tried it with zod but i cannot get to step 2 cause my step 2 fields also validated when clicking next to step 2.

    • @AustinShelby
      @AustinShelby  ปีที่แล้ว +1

      The way I showed it in this video won't work with zod. If you want to use zod I would make each step a separate form with their own validation.

  • @АлександрБычков-п6ж
    @АлександрБычков-п6ж 3 ปีที่แล้ว

    How to do? if I need check on unique email for registration in first step?

  • @kacperkepinski4990
    @kacperkepinski4990 ปีที่แล้ว

    u change only text and u have 2 different buttons thats .....

  • @kacperkepinski4990
    @kacperkepinski4990 ปีที่แล้ว

    there are millions of files on github

  • @Zullv
    @Zullv 2 ปีที่แล้ว +1

    Please don't make render functions which you then call inside of your page render. That's an anti-pattern; use react components. {formStep > 2 && }

  • @Cruzylife
    @Cruzylife ปีที่แล้ว

    Your repo is outdated

    • @AustinShelby
      @AustinShelby  ปีที่แล้ว

      That's true this video is already two years old. I might remake this tutorial with the latest tools and best practices.

  • @Supremevillacom-house
    @Supremevillacom-house ปีที่แล้ว

    thanks man