Multi-Step form with react-hook-form

Поделиться
HTML-код
  • Опубликовано: 15 ноя 2024

Комментарии • 71

  • @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.

  • @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.

  • @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?

  • @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!

  • @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.

  • @maungmaungtar9651
    @maungmaungtar9651 2 года назад +1

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

  • @ikwuegbuanthony6521
    @ikwuegbuanthony6521 2 года назад

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

  • @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!

  • @jakeruth4603
    @jakeruth4603 3 года назад +5

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

  • @cbijay
    @cbijay 2 года назад

    Great multi step form 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!

  • @cristhianeresende5663
    @cristhianeresende5663 2 года назад

    This really helped me! Thank you, Austin!

  • @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!!!

  • @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 RUclips.

    • @AustinShelby
      @AustinShelby  3 года назад +2

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

    • @Ricardoromero4444
      @Ricardoromero4444 3 года назад

      @@AustinShelby Looking forward to it!

  • @alisequeira1619
    @alisequeira1619 3 года назад

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

  • @bluebill1049
    @bluebill1049 3 года назад +3

    Thanks for producing this awesome tutorial!

  • @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

  • @altairtodescatto
    @altairtodescatto 2 года назад

    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 Год назад

    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?

  • @mrastrogastro
    @mrastrogastro 2 года назад

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

    • @AustinShelby
      @AustinShelby  2 года назад

      Glad you learned something! Thanks for watching

  • @kgetgamingentertainmenttec8243
    @kgetgamingentertainmenttec8243 2 года назад +1

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

  • @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?

  • @benwasonga
    @benwasonga 3 года назад

    this is exactly what I needed.
    Gracias

  • @em6663
    @em6663 2 года назад

    great work man !

  • @walaaemam6001
    @walaaemam6001 2 года назад

    Thank You Sir

  • @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?

  • @phongtruongxuan7221
    @phongtruongxuan7221 3 года назад

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

  • @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.

  • @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

  • @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

  • @ahmaat19
    @ahmaat19 2 года назад

    Thank you.

  • @DavisNorde
    @DavisNorde 3 года назад

    Thank you so much, Austin!

  • @jaggyjut
    @jaggyjut 3 года назад

    Cool. What about adding logic between the forms?

  • @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?

  • @chinomsojohnson8746
    @chinomsojohnson8746 3 года назад

    Thanks for this amazing tutorial.

  • @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. :-)

  • @soultouchingsongs
    @soultouchingsongs 3 года назад

    Excellent. Thanks a ton. Subscribed.

  • @waleedsharif618
    @waleedsharif618 3 года назад

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

  • @АлександрБычков-п6ж

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

  • @stefcioagoodboy
    @stefcioagoodboy 3 года назад +1

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

  • @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 !!!!!

  • @prathameshyerva248
    @prathameshyerva248 3 года назад

    time savior !

  • @longsyee
    @longsyee 3 года назад

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

  • @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 && }

  • @kacperkepinski4990
    @kacperkepinski4990 Год назад

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

  • @kacperkepinski4990
    @kacperkepinski4990 Год назад

    there are millions of files on github

  • @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