You really explain things easily. I believe that some people are born to be teachers.🙌✨
@hamedbahram3 күн бұрын
Thank you!
@raillyhugo32877 ай бұрын
Thank you, that's what exactly I was looking for. Concise and clear explanation! Keep up the good work!
@hamedbahram7 ай бұрын
Great to hear that!
@longsuabc11 ай бұрын
Really great and amazing video. Very clear explanations all the time. I am not a native English, but I can hear his English very clearly!! I respect you and your business!!! Cheers!!! From China! 💪💪✨✨👍👍👏👏
@hamedbahram11 ай бұрын
Great to hear that! Welcome to the channel.
@BreadfortheSoul-lb3zr4 ай бұрын
Thank you for taking the time to share this. The Lord Jesus bless you.
@hamedbahram4 ай бұрын
My pleasure! Glad it helped.
@jeremiahchinwe13364 ай бұрын
This video has really helped me achieve my task
@hamedbahram4 ай бұрын
Very glad to hear that.
@INetreba14 күн бұрын
Thank you! I like your vibe
@hamedbahram14 күн бұрын
Anytime!
@almaducatel58304 ай бұрын
Thank you verry much for your time. You are a blessing.
@hamedbahram4 ай бұрын
You are very welcome!
@leonardorocchini901211 ай бұрын
Nice video. that would be great to implement app routing in the multistep form so that we have a separate page for each step.
@hamedbahram11 ай бұрын
For sure!
@raymondmichael49873 ай бұрын
🤔🤔 actually that’s a good idea, I have several ways to leverage it “I guess “😊
@alexavery818210 ай бұрын
Hamed always delivers great content
@hamedbahram10 ай бұрын
Appreciate that!
@sundayucheawaji62064 ай бұрын
Thanks for this. It was really helpful.
@hamedbahram4 ай бұрын
Glad it was helpful!
@yogawithaaron5 ай бұрын
This video was tremendously helpful. Ty!
@hamedbahram5 ай бұрын
Glad it was helpful!
@irfansaeedkhan72423 ай бұрын
too much code in one component killed the main motive of react, it would have better to also show if each form is in different component because form could be bigger
@hamedbahram3 ай бұрын
This video is not so much about React component composition but more so about the concept of a multi-step form implemented using react-hook-form and zod for validation.
@raymondmichael49873 ай бұрын
Using multiple forms for this lesson would have made the video too complicated for me. I think for delivering the intended concept, he chose the best approach. Once we understand the concept it’ll be much easier to na split the form into much smaller forms as we want and he mentioned it clearly 😊
@raymondmichael49873 ай бұрын
@@hamedbahramthanks man, keep them coming ❤
@OutrospectiveOfficial2 ай бұрын
Excellent content, thank you!
@hamedbahram2 ай бұрын
Glad it was helpful!
@ammarhaidar599511 ай бұрын
Awesome, just in time🎉🎉, appreciate your content, thanx.
@hamedbahram11 ай бұрын
Glad to hear that!
@alir8zana63510 ай бұрын
thank you so much for this video it really helped me implement it in my own project your videos are great and I hope you great success
@hamedbahram10 ай бұрын
You're very welcome! I'm glad it helped, and I appreciate your comment!
@htetlinlinnaing49943 ай бұрын
Thank you for your amazing Next.js content! If you have time, could you make a tutorial on adding/removing multiple fields dynamically on button click? It would be super helpful!
@hamedbahram3 ай бұрын
My pleasure! Do you mean adding conditional steps?
@htetlinlinnaing49943 ай бұрын
@@hamedbahram I meant a form where I can add or remove multiple fields dynamically, like adding or removing phone number fields on button click. Thank!
@raymondmichael49873 ай бұрын
I think you mean handling fieldArray 😊. it’s a good one to learn from expert.
@yasserhy11 ай бұрын
As always, brilliant video ❤
@hamedbahram11 ай бұрын
Thank you! Cheers!
@almaducatel58304 ай бұрын
As always He save me.
@alextwin200e38 ай бұрын
Thank you very much! It helped me a lot. Great content!
@hamedbahram8 ай бұрын
You're welcome! Glad it helped!
@ivandamyanov7 ай бұрын
Thanks for the great video. I really like react-hook-form but there seem to be very few videos about an important integration - custom inputs + react hook form. I read 3 different articles for different versions of the library and it is all implemented differently and some things don't work. Especially with a Typescript environment. I like that library but it proves to be very complicated for beginners to use it in a reusable way (custom components). Would be awesome if you could do a short video on that or redirect me to any good example you might know of for the latest version.
@hamedbahram7 ай бұрын
Tell me more... are you using a UI library for your custom components?
@kyle-andrewgovinder990211 ай бұрын
Always providing us with amazing content, Hamed It's safe to say you taught me everything I know about Next
@hamedbahram11 ай бұрын
Glad to hear that! I appreciate your comment.
@hqasmei11 ай бұрын
Another great video, thanks Hamed!
@hamedbahram11 ай бұрын
I appreciate it, Hosna! What is similar to how you implemented it?
@siebe68111 ай бұрын
This was something I was searching for! Thank you!
@hamedbahram11 ай бұрын
You're welcome!
@imkir4n11 ай бұрын
Wow i was looking for the same🔥
@hamedbahram11 ай бұрын
There you have it!
@kristian97011 ай бұрын
Great video! Thank you!
@hamedbahram11 ай бұрын
You're welcome!
@usamausman522511 ай бұрын
Please make a complete series on Next 14
@hamedbahram11 ай бұрын
Everything is the same in NextJs 14, nothing has changed :) The only change is that server actions are now stable. But I'll make a video reviewing the release.
@YasamanKarbasi4 ай бұрын
THANK UUU
@hamedbahram4 ай бұрын
Anytime!
@SanderCokart11 ай бұрын
We need a version that cam scale infinitely using lazy and pre loading but idk how you preload component 3 while component 2 is showing for example.
@hamedbahram11 ай бұрын
Maybe have them as different components and lazy load the components and pass the promise to the form component. Just thinking out loud here...
@tomasburian65502 ай бұрын
What always gives me hard time is trying to figure out some extra features that would fit into the process because as a pro I tend to get tasks that are easily out of the ordinary use case. For example, I want the user to input his company number on the first step and then not only validate that the input is not empty, but also that the number they provided is real and not made up. Is there a way to run a custom function for each step that would do something before it would let the user go on to the next step?
@hamedbahram2 ай бұрын
Yes you can have custom validation for each field.
@arezootony97157 ай бұрын
Amazing video. How do we disable the buttons in each step if the required fields are not filled ?
@hamedbahram7 ай бұрын
Thank you! You can look at the `formState` returned from the `useFrom` hook.
@arezootony97157 ай бұрын
@@hamedbahram I tried isValid and isDirty but they do not work properly and I think the reason is they are matching with the whole Zod schema and not the items on the page.
@hamedbahram7 ай бұрын
@@arezootony9715 seem like the solution would be to have separate forms for each step and hold the collected data in a global state.
@arezootony97157 ай бұрын
@@hamedbahram yes, that is exactly how I was doing with the forms I have. My only problem is keeping the form state when the user goes back to the previous form/step and see the form filled.
@hamedbahram7 ай бұрын
@@arezootony9715 you need to lift the state of the form up to the parent or a global state.
@leilamohamadpor348110 ай бұрын
خیلی عالی بود.این چیزی بود که من الان داشتم دنبال آن می گشتم من یک فرم با تعداد خیلی زیادی المنت دارم که باید مقادیر آنها را از کاربر دریافت کنم آیا به نظر شما لازم است که از state management ها استفاده کنم؟ اگر راهنمایی ب فرمایید ممنون می شوم
@hamedbahram10 ай бұрын
Khoshhaalam Leila Jan! Welcome to the channel 🙂
@trusht11 ай бұрын
Thanks sir for the detailed explanation. I have tailwinds subscription so decided to apply this to my app. I am thinking to save input data to local storage just in case if the user navigates away with tons of information typed and when they come back to the form without frustration. What do you think?
@hamedbahram11 ай бұрын
That's great idea Tacettin! I'd love for you to contribute to this project. Open a PR for the storage.
@dosamuel-mb4 ай бұрын
Hello, i added a button to submit the data to the API, but i can't even see my data in the console, i can't even log them and there is no error at all. Can someone help please ?
@hamedbahram4 ай бұрын
Clone my code and see what you're doing differently.
@saiguna66762 ай бұрын
Thank you for the amazing video but if i have optional fields it's not working for that one how to solve it sir
@hamedbahram2 ай бұрын
What is an optional field, one that's not required you mean?
@user-gm3lg8gp3m4 ай бұрын
thank you
@hamedbahram4 ай бұрын
My pleasure!
@kyleroath8 ай бұрын
I know this weird, but I kept thinking like damn that chair looks comfy. Can anyone identify which chair that is?
@hamedbahram8 ай бұрын
Haha 😅 Its from IKEA, the model name is Markus.
@kyleroath8 ай бұрын
@@hamedbahram ha thank you sir. sorry for the weirdness, thanks for the vid too!
@hamedbahram8 ай бұрын
@@kyleroath no worries!
@davidfarah9 ай бұрын
Thanks
@hamedbahram9 ай бұрын
You're welcome!
@AmitErandoleАй бұрын
What if we need to show errors while the user is typing? Do we enable the onChange mode on react hook form?
@hamedbahramАй бұрын
You can set the mode to onChange or separate the steps to individual forms.
@AmitErandoleАй бұрын
@@hamedbahram ok will try that. Thank you for sharing your repos. They are quite helpful
@kennethlau81087 ай бұрын
If we add a file upload input for example in step2 clicked next tp step3 and click back. It will have an error.
@hamedbahram7 ай бұрын
Yeah this isn't a one-size-fits-all solution, you'd have to handle file inputs probably with separate forms for each step.
@kennethlau81087 ай бұрын
@@hamedbahram any recommended ways to do so ?
@hamedbahram7 ай бұрын
@@kennethlau8108 watch this → kzbin.info/www/bejne/eZaknKuMrNisg7c
@dogcodes6 ай бұрын
Is there a way to remove the validation error message when the user inputs again after validation. So after the "is required" is shown then when I type again that message is not rendered
@hamedbahram6 ай бұрын
You can pass `mode:"onchange"` or if you don't want to trigger state update on change, you can separate each step to an individual form and hold a global state for all the steps.
@dogcodes6 ай бұрын
@@hamedbahram Thank you!
@imkir4n10 ай бұрын
12:05 hamed why the error is keep complaining even after user entered into the field?
@hamedbahram10 ай бұрын
You can set the `mode` to `onChange` to update the error as the user corrects it.
@imkir4n10 ай бұрын
@@hamedbahram Thanks it worked. But Will this lead to multiple re-renders?
@hamedbahram10 ай бұрын
@@imkir4n Yup it does. I don't know of any other way to watch the changes on the fields to wipe out the errors once we triggered the validation.
@dhirajavasthi653910 ай бұрын
Hello @hamedbahram your content is very helpful can you please help me in below problam using zod and next js 13 or 14 problem : How to read content of uploaded json file on react / next.js 13 or 14 using zod
@hamedbahram10 ай бұрын
Not sure if I understand that. Zod is for validating or parsing an object, what do you mean by reading a json file?
@abdulmalikzihad35428 ай бұрын
Will the 2nd step submit the automatically?
@hamedbahram8 ай бұрын
Yes if it passes the validation it submits the form.
@navjotsingh24578 ай бұрын
tysm
@hamedbahram8 ай бұрын
?
@juniorsemerzier66010 ай бұрын
how to remove the error message after the correction of the input value?
@hamedbahram10 ай бұрын
You can pass mode: "onChange" to the `useForm` hook.
@codingwithlucy9 ай бұрын
@@hamedbahram I was just coming to ask the same question. What do you mean? Do you mean that on every form field you would use trigger on onChange?
@hamedbahram9 ай бұрын
@@codingwithlucy What I meant is to pass the `mode` property to the `useForm` hook like so ↓ ``` const { register, trigger, ... } = useForm({ ... mode: "onChange" ... }) ``` Does this answer your question?
@AravindK-tv5rh9 ай бұрын
@@hamedbahram Isn't there any other way? like how it works normally in react hook form for a normal form...
@hamedbahram9 ай бұрын
@@AravindK-tv5rh I'm not aware of any other way! Let me know if you could come up with something else from the docs.
@OmarDugha-o6l9 ай бұрын
❤❤❤
@hamedbahram9 ай бұрын
❤️
@dolapojohnsonn6 ай бұрын
Nice content. But can I get access to the github repo please?