ReactJS Course [11] - React-Hook-Form and YUP Tutorial | How to do Forms The Right Way

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 139

  • @mitch1668
    @mitch1668 Рік тому +24

    Hey Pedro, thank you for this ReactJS Course as well as all the other videos you've posted.

    • @PedroTechnologies
      @PedroTechnologies  Рік тому +2

      Thank you for the support! I am happy to hear you liked the course :)

  • @abdessamade6995
    @abdessamade6995 2 роки тому +9

    you can write:
    {errors.fullName && {errors.fullName.message}}
    instead of:
    {errors.email?.message}

    • @FirasMohamed96
      @FirasMohamed96 6 місяців тому +1

      you right too, but look at both codes again,
      you can tell why his way is better. his more minimalist

  • @princesshemen9414
    @princesshemen9414 9 місяців тому +1

    Hi Pedro. I just want to say, all the way from Nigeria, thank you so much for these React videos. Not everyone can afford those paid courses and you have been a lifesaver. Please keep it up.

  • @as_404_as
    @as_404_as Рік тому +4

    for the required, min, max, minLength, maxLength feature we can directly use the default input tag properties. For that why should we use Yup package methods like requried(), min(), ... ?
    like this (This is working as expected):

    • @hazema.6150
      @hazema.6150 9 місяців тому

      that is what I was thinking. Maybe there is something that I don't know about the input tag that makes it unsafe??

  • @dm3424
    @dm3424 Рік тому +1

    Pedro you are the best!!! I ve been studying full stack development for a year, my dream is to change career and be a programmer.
    Your videos are great , you speak really clearly and it is easy to understand even for a non native English speaker, keep up the good work!!

  • @kgosikgosi5595
    @kgosikgosi5595 7 місяців тому

    Your tutorials have helped me a lot. When is the backend course coming?

  • @JonBrookes
    @JonBrookes 2 роки тому +5

    Hi Pedro,
    this video is fantastic - very clear, very concise and so much easier to adopt these libraries than to write it yourself - thank you for posting this
    🙂

  • @reginacheong4596
    @reginacheong4596 2 роки тому +1

    Thank you for this efficient way to validate form inputs which is essential for every app with a sign in. Thank you for all your content. Yours has become the first resource I check for whenever I want to learn about something.

  • @nawazishali274
    @nawazishali274 2 роки тому +1

    Plz make playlist with material ui alongwith react hool form and yup explore all functions of react hook form like watch setValue and other

  • @hamzapaskingakhtar
    @hamzapaskingakhtar Рік тому

    This is good just need to wrap my head around it. Would be cool if you can make a video on how to read and understand documentation, best practices and how to apply them accordingly.

  • @olenayevtushok2014
    @olenayevtushok2014 Рік тому +1

    Thank you for this video! It's really amazing that you use real tools to explain, not just manually write some validation using if statements etc...

  • @Solomer5569
    @Solomer5569 11 місяців тому +1

    Cannot read properties of null (reading 'useRef')
    TypeError: Cannot read properties of null (reading 'useRef') I am getting this error why?

  • @RohitKumar-ht4sr
    @RohitKumar-ht4sr 2 роки тому +2

    How yout terminal sujjesting you the packages?

  • @martinirungu2381
    @martinirungu2381 2 роки тому +2

    You have the best react contents bro and your explanation is top notch. Keep em coming

  • @UsamaJaved-j7z
    @UsamaJaved-j7z Рік тому

    Simple and clear explanation. Thank you.

  • @soumeshnayak4546
    @soumeshnayak4546 2 роки тому +1

    thnx pedro sir for this awesome video

  • @stn369
    @stn369 2 роки тому +5

    Hey, bro massively appreciate your efforts and respect your teachings!

  • @Salah-YT
    @Salah-YT 2 роки тому +2

    thank u so much bro it was so amazing video bro and I did follow you until the end so everything was perfect bro and I'll upload it to my GitHub just for my self for future thx bro

  • @DSIRAGGIE
    @DSIRAGGIE Рік тому +2

    Pedro, Thank you so much! You're an excellent teacher and you stay on topic; making it easier to grasp the concept.

  • @taiwooladosu3784
    @taiwooladosu3784 2 роки тому

    There is something about your way of teaching.. It sinks in immediately.. Thanks Pedro

  • @qasimmehmood76
    @qasimmehmood76 Рік тому +1

    for validation shouldn't we use html5 validations? it has almost all validations that we did in this video - type= "email", required etc

  • @georgegodwin5866
    @georgegodwin5866 Рік тому

    Pedro, I have been following your videos on UA-cam. you are simply the best. you make programming so easy for people like us. thank you so much. George from Nigeria.

  • @TestingKyoshi
    @TestingKyoshi Рік тому

    My form is returning (Module parse failed: Unexpected token (51:21)
    You may need an appropriate loader to handle this file type.
    | columnNumber: 13
    | }
    > }, errors.fullName?.schema), /*#__PURE__*/React.createElement("input", Object.assign({
    | type: "text",
    | placeholder: "Email")
    this error will please guide me

  • @fernandogouveia2924
    @fernandogouveia2924 Рік тому

    Thanks a lot, dude! This short video hooked me up big time! It would be interesting to see an extension of this video, where it could include 'masks' for the input fields. It would give a more professional look to the form overall.
    Aside from that, this is a really good tutorial, thanks again! Cheers from Brazil!

  • @Pareshbpatel
    @Pareshbpatel 2 роки тому

    Using React-Hook-Form and Yup to create React Forms, so clearly explained. Thanks, Pedro.
    {2022-11-13}. Implemented:{2022-11-14}

  • @IND_Abhi
    @IND_Abhi 2 роки тому +1

    just started folowing this react course is it gonna be complete like redux and all that or just some basics

  • @sherothkar5809
    @sherothkar5809 2 роки тому +2

    You are directly teaching the thing that which really needed 👍👌

  • @nickmob8191
    @nickmob8191 2 роки тому +1

    Good job, Pedro! Thanks. Please, tell what a terminal extension for suggestions you use?

  • @HR-pz7ts
    @HR-pz7ts 10 місяців тому

    You can put required in the input tho. And how can you put characters when the input type is number??

  • @samuelngene6513
    @samuelngene6513 2 роки тому +8

    Please can you make a series for next Js .. I just finished the next Js video you have. It was really good. I want to learn more

  • @dasaridineshkumar9057
    @dasaridineshkumar9057 2 роки тому

    hey by adding the register in input the ui is not taking values

  • @sumitsaha6941
    @sumitsaha6941 Рік тому

    Learn lots of things from this video.

  • @takek7739
    @takek7739 2 роки тому +1

    @Pedrotech After clicking the submit button how do we clear all the inputs in the input fields ?

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому

      You can create a ref to the inputs and set their values to an empty string. I didn't teach useRef in this course, buut its not that complex!!

    • @takek7739
      @takek7739 2 роки тому

      Thanks man keep doing great videos . Good luck

  • @Adarshabinash
    @Adarshabinash Рік тому

    Thanks pedro...I was searching a video on this topic

  • @muhammadmohsinhussain5428
    @muhammadmohsinhussain5428 Рік тому +1

    Thank you so much Pedro.

  • @nic_jaws
    @nic_jaws 2 роки тому

    Thanks for all these videos Pedro. We really appreciate your channel.

  • @doppel33
    @doppel33 2 роки тому +1

    Thanks Pedro, I’m really enjoying and learning a lot from this serie!
    I saw another youtuber saying that Zod is the industry standard for validation nowadays. Any reason for choosing Yup over Zod?

  • @Mehedi.Developer
    @Mehedi.Developer Рік тому

    Bro, could you tell, me how you get autocomplete suggestions on your terminal when entering any command?

  • @scrapbookk8775
    @scrapbookk8775 11 місяців тому

    This was the perfect tutorial, thank you man

  • @josecarlosparada3171
    @josecarlosparada3171 2 роки тому

    You are the MVP Pedro! Your videos are the best!

  • @codetheworld6721
    @codetheworld6721 Рік тому

    thankyou bro , please include file upload and select box in this form..

  • @monty_2969
    @monty_2969 2 роки тому

    Great vid ! I wanted to do exactly the same. Use react hook form + yup validation. You saved me the trouble of reading through the docs

  • @kruthikeshmk
    @kruthikeshmk 2 роки тому

    {...register("name")}
    this line is not letting me type anything in input box.....any idea why?
    I have used custom input fields and I know its this line which is causing the trouble because I'm able to type once I comment out this line.............
    Please help @pedro

  • @DriveandThrive
    @DriveandThrive 2 роки тому

    Appreciate your series

  • @maingii
    @maingii Рік тому

    the validation for age error looks like these with empty field on it age must be a `number` type, but the final value was: `NaN` (cast from the value `""`). how can we change it

  • @emamarcela354
    @emamarcela354 2 роки тому +1

    Hi Pedro. I was practicing this and I realized these two libraries don't work with styled-components. Do you know why or if there's a way to do it?

  • @eriknorden9388
    @eriknorden9388 2 роки тому +1

    Thank you so much for the Course Pedro. It's amazing - I am learn so much. One Question though: Would I use YUP and Typescript combined? ... Or is it more like only one of the two?

  • @abdelmonem88
    @abdelmonem88 2 роки тому

    thanks alot bro it was something very important to know

  • @Kennomie
    @Kennomie 2 роки тому

    Hi Pedro, You explanation is very clear and I am able to make a form in react by following your video. One question I have is how can we validate the input as user type without submitting the form? I think that would improve user experience even more. Thanks!

  • @andreasacardio6289
    @andreasacardio6289 Рік тому

    awesome lesson bro !

  • @stephenondieki2200
    @stephenondieki2200 10 місяців тому

    this guy just nailed.

  • @kaderathbun
    @kaderathbun 2 роки тому

    Great video 👊

  • @aaronfive-5
    @aaronfive-5 Рік тому

    thanks a lot, Pedro. you are amazing

  • @AzedineOuhadou
    @AzedineOuhadou Рік тому

    great one pedro

  • @ronnykn2108
    @ronnykn2108 Рік тому

    U can write form validation from the HTML ex:

  • @lrabeno
    @lrabeno 2 роки тому

    Anyone know how we would get rid of the space between each input? I tried using a ternary to display the or nothing but can't get the space to go away.

    • @emamarcela354
      @emamarcela354 2 роки тому

      Someone already wrote the solution in the comments. You can check it out but it's basically using a ternary operator like this {errors.fullName?{errors.fullName.message}} you can also use && instead of ?

  • @wadf29
    @wadf29 2 роки тому

    Pedro you are a great instructor. Thank you for your contribution.

  • @k303k
    @k303k 2 роки тому

    Thanks a lot Pedro!

  • @Pedro21Torres
    @Pedro21Torres 2 роки тому

    Thank you so much Pedro for all this episodes!

  • @abin9262
    @abin9262 2 роки тому

    what is the name of the theme..?

  • @ИннаБогданова-к4щ
    @ИннаБогданова-к4щ 2 роки тому

    Pedro, we are waiting for new series!!! millions thanx for your wirk!

  • @vikrambam1184
    @vikrambam1184 2 роки тому

    how to empty form after submit

  • @wadf29
    @wadf29 2 роки тому

    Would this work with typescript?

  • @RoborobsComputers
    @RoborobsComputers 2 роки тому

    How do you do this in typescript?

  • @pauloricardomaltaleal3558
    @pauloricardomaltaleal3558 Рік тому

    Im like so much the course. If someone already work with React see this comment, these librarys is being used yet?

  • @hamdihawari
    @hamdihawari Рік тому

    Thank you for this very good Tutorial. I wonder, how do i clear the values after submitting, Thank you

  • @mahmoudrabbas
    @mahmoudrabbas 2 роки тому +1

    How to customize the error message of the "number input" if the user does not write their age? the default error message is really ugly :)
    But as usual you're doing an amzing job bro!

    • @mahmoudrabbas
      @mahmoudrabbas 2 роки тому +1

      I do customize it through required function but it says that "age must be a number type but it gets NaN" !! isn't NaN a type of number LOL

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому

      NaN stands for Not-A-Number hahahaha

    • @mahmoudrabbas
      @mahmoudrabbas 2 роки тому

      @@PedroTechnologies yea but if you check its type you will find it type of number 😁

    • @mahmoudrabbas
      @mahmoudrabbas 2 роки тому

      Try "typeof NaN" you'll get number!..

    • @mahmoudrabbas
      @mahmoudrabbas 2 роки тому

      Seems weird and now i just knew why javascript is written in just ten days lol

  • @ziyasiddiqui5566
    @ziyasiddiqui5566 2 роки тому

    Hey Brotha, why in string() method also accepting numers . // In the Name Field 🤔

  • @Art-ee6nn
    @Art-ee6nn 2 роки тому +1

    You aren't going to continue this course?

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому +1

      I am, next episode comes out tommorrow! I took a week break but im back strong 💪

  • @noobresistance
    @noobresistance Рік тому

    thanks pedro for such a beautiful course my friend . i am learning a lot from you .. but I am facing a problem here in yup.string().required() function in schema. string is not working properly . if a enter some numbers instead of sting in Name . it is accepting it as a string of integer. can you please check it ?

  • @3TQHAJSHNQ
    @3TQHAJSHNQ 2 роки тому

    Hey Pedro, does this handle the server side of things? Or is this solely client-side?

  • @mikidai3575
    @mikidai3575 Рік тому

    very effective and helpful

  • @crowbr
    @crowbr 2 роки тому

    Gj my friend, how I can validate arrays inputs like select with multiple values or a file input like an filepicker in Yup ? Thanks mate congrats from Brazil.

  • @forestlin6164
    @forestlin6164 2 роки тому

    Thanks, Pedro. Your video is clean and useful. And helping me to get a job!

  • @Rahulyadav-lv7dh
    @Rahulyadav-lv7dh 2 роки тому

    Awesome content♥️

  • @sonamohialdin3376
    @sonamohialdin3376 2 роки тому

    Awesome tutorial thank you

  • @2006Pk
    @2006Pk 2 роки тому

    Thanks a lot for all your videos! Very helpful 🙂

  • @HarshBhardwaj-r6w
    @HarshBhardwaj-r6w 9 місяців тому

    Very Helpful content bro
    love from india

  • @amritshrestha5839
    @amritshrestha5839 4 місяці тому

    really appreciated !!

  • @abin9262
    @abin9262 2 роки тому

    Nice tutorial

  • @Aliena92
    @Aliena92 Рік тому

    Wow, thanks a lot!

  • @abdessamade6995
    @abdessamade6995 2 роки тому

    you're really making react look easier ♥♥♥

  • @mouhamedoussemarouis524
    @mouhamedoussemarouis524 Рік тому +1

    well done🙂

  • @houssemflutter2722
    @houssemflutter2722 2 роки тому +4

    If you continue like this, you will become the undisputed react king 🙂🙂.. you are really amazing bro ...
    Only I see and this is a personal opinion that the best way to control the form is the normal way without using the form-hook only useState ... it is enough to control the inputs and outputs 👍❤️🇩🇿

    • @PedroTechnologies
      @PedroTechnologies  2 роки тому +2

      There is no correct answer, but I do recommend using a library such as react-hook-form

    • @absurdist1330
      @absurdist1330 2 роки тому

      react-hook-form I think is the most flexible, fewer lines of code. If you want to handle everything yourself - no dependencies philosophy - maybe you would opt out of it...

    • @absurdist1330
      @absurdist1330 2 роки тому +1

      @@houssemflutter2722 I think you grossly misunderstood me haha. I am just saying - if you want to handle the issue with forms flexibly - use rhf. If not, sure you can opt out of it/not use it. What has respect have to do with anything?

    • @houssemflutter2722
      @houssemflutter2722 2 роки тому +1

      @@absurdist1330 Oh my God, I really misunderstood, I apologize brother, I understood that you want me to withdraw from the video because I do not like using libraries,sorry brother, I will delete the comment and I am very honored to be your friend 🤦🏻‍♂🤦🏻‍♂

  • @stephenondieki2200
    @stephenondieki2200 10 місяців тому

    very nice man

  • @sanmarchen
    @sanmarchen 2 роки тому

    Pedro, you are awesome!

  • @garnica_hector
    @garnica_hector 2 роки тому +8

    Thank you Pedro for these videos and lessons, and for taking the time to teach so many people, including myself. Hopefully I can land my first front-end developer job soon and donate to the channel. You are amazing! 😁

  • @yelukurusandeep4596
    @yelukurusandeep4596 2 роки тому

    Tq so much Pedro....😇

  • @AlttoA
    @AlttoA Рік тому

    thank you pedro bro

  • @muradjadoon619
    @muradjadoon619 2 роки тому

    great explanation @pedroTech 👏👏

  • @WahabShah23
    @WahabShah23 2 роки тому

    Awesome!

  • @RelaxingSounds-bl1dv
    @RelaxingSounds-bl1dv 2 роки тому

    @PedroTech there will be also a REDUX tutorial included? I mean for React 18 .... Ty for your work bro :D you're amazing !😇

  • @amankushwaha8180
    @amankushwaha8180 Рік тому

    great video

  • @loyaltythameem
    @loyaltythameem 2 роки тому

    Please continue to reactjs with realtime project

  • @ankushagarwal7378
    @ankushagarwal7378 2 роки тому

    Thank you pedro for teaching react btw how to post data using react forms and please tech us redux after this course

  • @Amvflix7
    @Amvflix7 2 роки тому

    Thanks Pedro...
    Love from India ❤️🫂

  • @loyaltythameem
    @loyaltythameem 2 роки тому

    Great 👍 video

  • @danielpreza4159
    @danielpreza4159 2 роки тому

    I want yo give you a challenge, What if you make something with mui autocomplete?

  • @codeaccount4931
    @codeaccount4931 2 роки тому

    amazing!

  • @hunterbidenafterlife
    @hunterbidenafterlife 2 роки тому

    ah bruh that terminal intellisense is so sick rip me, a windows user