Custom hooks in react | currency Project

  Рет қаралды 23,132

Hitesh Choudhary

Hitesh Choudhary

Күн бұрын

In this comprehensive tutorial, you'll dive deep into mastering React by building a currency converter project. This project not only enhances your understanding of custom hooks but also demonstrates the importance of component reusability in React. The tutorial begins with setting up the project using Tailwind CSS for styling, followed by designing input components that can be reused efficiently. You'll learn how to create your own custom hooks to handle API requests, ensuring that the app remains scalable and easy to manage. The tutorial also covers state management and how to handle form submissions in React, emphasizing best practices like using useState and useEffect hooks. Additionally, you'll explore advanced topics like generating unique IDs using useId and handling asynchronous operations with fetch. By the end of this tutorial, you'll have a solid understanding of creating React components that are not only functional but also highly reusable, giving you the confidence to build more complex React applications in the future. Perfect for those looking to bolster their React skills and add a robust project to their portfolio.
Welcome to a youtube channel dedicated to programming and coding related tutorials. We talk about tech, write code, discuss about cloud and devops. That’s what we do all day, all year. We roll out a lot of series and videos on our channel.
All the learning resources such as code files, documentations, articles and community discussions are available on our website:
chaicode.com/
You can find our discord link, github link etc on the above website.
Twitter/X link: x.com/hiteshdo...
Discord link: hitesh.ai/discord
Learn React with 10 projects: • Let's learn react from...
Learn Docker: • A practical guide on D...
Learn Kubernetes: • Complete Kubernetes Co...
How does a browser works: • How does a browser wor...
How nodejs works: • How node JS works | En...
Learn Redux-toolkit: • Learn Redux Toolkit in...
Learn NextJS: • Nextjs Full stack course
Learn Typescript: • Why to learn Typescript
Learn Javascript: • Welcome to new JavaScr...
Learn React Native: • React Native Mastery: ...
Learn Zustand: • React state management...
Learn Golang: • How to get started wit...

Пікірлер: 149
@vedantdeshpande2723
@vedantdeshpande2723 Жыл бұрын
Really thank you this is one of the best react series I have watched and really appreciate your hard work man
@Roshan-fy5rk
@Roshan-fy5rk 3 ай бұрын
you are teaching exactly the way everyone wants to be taught. Appreciate your effort a ton . your youtube tutorials are our poor students best go to while cant pay extra for any course than our college. God bless you for that Brother.😇😇
@ItsjustStarFoxNBD
@ItsjustStarFoxNBD 11 ай бұрын
Hitesh your videos are incredible. Thank you so much!
@utkarshgb27
@utkarshgb27 6 ай бұрын
Thank you so much, Hitesh Choudhary sir, for the incredible React tutorial! It's by far the best one I've seen on KZbin and has made my React journey so much easier. I’m starting to believe that I can truly learn React thanks to your guidance!
@kattamurinagabhushan9879
@kattamurinagabhushan9879 10 ай бұрын
i just love to watch your tutorials. Learning a lot of courses from you. Thankyou for your efforts.
@jessekM10
@jessekM10 Жыл бұрын
Hello Hitesh I just want to thank you for this series coz it has helped me alot
@lcandao8660
@lcandao8660 Жыл бұрын
I'm nearing the end of the current videos in this series and I'm extremely satisfied with the explanations. Keep up the great content.
@awnishprasad9367
@awnishprasad9367 Жыл бұрын
from where i get those api
@akashmatsagar9970
@akashmatsagar9970 Жыл бұрын
My friend purchased a course at just 200 rupees cost react course and now he at 12 lpa ..& this is the power of learning quality at this amount in this costful world.i also purchased
@HrissW
@HrissW Жыл бұрын
Fr? Is it his first job?
@akashmatsagar9970
@akashmatsagar9970 Жыл бұрын
Yes his starting actually half of above but within six months he is at above in same company@@HrissW
@_sarthakmisal
@_sarthakmisal Жыл бұрын
Naah bruh ​@@HrissW
@Nomadic_picxoman
@Nomadic_picxoman 6 ай бұрын
Course link
@rakteemmullick2908
@rakteemmullick2908 10 ай бұрын
thank you very much sir for such an amazing tutorial. Especially the concept of hooks got much more clearer to me.
@sharathkumar726
@sharathkumar726 10 ай бұрын
You are amazing teaching skills with great attitude....👍
@ritwikyadav9749
@ritwikyadav9749 Жыл бұрын
Thanks Hitesh for these videos, this is one of the best into to react series I have watched. Like it when you explain a lot of other simple concepts like fetch vs axios etc which helps us revise JS as well.
@christophermawela3318
@christophermawela3318 5 ай бұрын
Thanks Sir, this tutorial has been hard but you explanations made it easier. I will revise this session after finishing the entire series, once I'm comfortable with creating simpler React projects, I will buy your complete course, I'm now moving to the next tutorial. React Router
@brunohenrard
@brunohenrard 8 ай бұрын
Thank you for these high quality videos, I'm watching them and then trying to make the app on my own. It looks easy when you are doing it but much more difficult while being alone :-).
@saimanu1997
@saimanu1997 Жыл бұрын
Thank you so much Hitesh, as usual your teaching is top notch.
@Donald.L.Rosenberg
@Donald.L.Rosenberg 8 ай бұрын
Hitesh your videos are incredible. Thank you so much!
@Adventures_English
@Adventures_English Жыл бұрын
Another great video. Thanks again! You are a great teacher!
@zues8150
@zues8150 6 ай бұрын
Great Project Sir even i have completed more complex project on react but this one was just perfect that's it 🔥
@loudcapricorn5513
@loudcapricorn5513 10 ай бұрын
This was a really great video providing deep learning which is actually asked in interviews. Thank you for this wonderful content
@erbhargavvyas
@erbhargavvyas 5 ай бұрын
Thanks for the Awesome tutorial.
@pawankand
@pawankand Жыл бұрын
Very much clear about custom hook in react post watching this video. Thanks Hitesh for great video and am sure this series will be super exciting with upcoming videos :-)
@ravisankarp61
@ravisankarp61 Жыл бұрын
​Thank you so much, this video has helped a lot and I have learned a lot .Will watch more videos on ur channel.
@ErsanGökalp
@ErsanGökalp Жыл бұрын
You give me so much positive energy. Blieve me, this has equal important to information itself
@devaprem7777
@devaprem7777 Жыл бұрын
IT HELPS ME A LOT TO GO THOUGHT THE CONCEPTS BRO... THANKS A LOT
@iBounty12
@iBounty12 Жыл бұрын
really good project with lot to learn from it, thanks
@mahendrarajput2870
@mahendrarajput2870 11 ай бұрын
thank brother for sharing content.
@manjuhakki5635
@manjuhakki5635 Жыл бұрын
Nice video. Keep doing it consistently.
@divinendubuisi9593
@divinendubuisi9593 Жыл бұрын
thank you for the project, a lot was learned. I really appreciate
@aimenazim1508
@aimenazim1508 6 ай бұрын
Well, I must say I learn quite a lot, I was scared of custom hooks I never touched I but I'm confident now.
@aniket7390
@aniket7390 Жыл бұрын
Completed the project with tsx, found one issue with swapping values but thanks to comment section i was able to figure it out quickly. Thank you so much hitesh
@sandeepanmazumdar8486
@sandeepanmazumdar8486 11 ай бұрын
did you face issue while fetching the data from api? if not, can you please help?
@PranayAcharya-qz6tf
@PranayAcharya-qz6tf 5 ай бұрын
@@sandeepanmazumdar8486 bro, is your problem solved. if yes please help me out iam also facing issue while fetching the data its showing a message of unable to fetch
@manipalreddy3378
@manipalreddy3378 5 ай бұрын
@@sandeepanmazumdar8486 i am facing the same issue bro, did you resolved it?
@vedangop4918
@vedangop4918 4 ай бұрын
@@sandeepanmazumdar8486 did u resolve it coz i did too!!
@ChetnaAglawe
@ChetnaAglawe 11 ай бұрын
Thank you so much ,great learning video, help a lot.
@Ronieyit
@Ronieyit 6 ай бұрын
best of the best. thanks Mr. Hitesh
@morecoinbull
@morecoinbull Жыл бұрын
thanks for making these. they are really helpful!!
@hajsdusau
@hajsdusau 9 ай бұрын
Great Video Hitesh!
@dolfieaspeling9893
@dolfieaspeling9893 Жыл бұрын
Another banger , keep them coming :)
@ChandanSahu-ub8mp
@ChandanSahu-ub8mp 7 ай бұрын
Really helpful video. Loved it❤
@souvikdas_01
@souvikdas_01 8 ай бұрын
Thank you sir for such an amazing react content.
@purvesh62
@purvesh62 Жыл бұрын
Thank you for another informative video.
@prasadpatil2371
@prasadpatil2371 Жыл бұрын
Absolutely enjoyed the latest video! Gained some valuable knowledge-thanks a bunch!
@Adventures_English
@Adventures_English Жыл бұрын
If you can't figure out why the values are not swapping consider this from MDN: TYPE The type of the button. Possible values are: SUBMIT: The button submits the form data to the server. This is the default if the attribute is not specified, or if the attribute is dynamically changed to an empty or invalid value. RESET: The button resets all the controls to their initial values. BUTTON: The button has no default behavior. It can have client-side scripts associated with the element's events, which are triggered when the events occur.
@youtubecodinggithub6145
@youtubecodinggithub6145 8 ай бұрын
I really don't comment to any video i am not that person but seriously saying you are a gem and i love the content from kerala 😍
@achuthanboovaragan3546
@achuthanboovaragan3546 Жыл бұрын
Learnt about custom hooks clearly. Thank you!!
@NikhilGupta-qn8jl
@NikhilGupta-qn8jl 9 ай бұрын
Thanks for amazing content.
@mohammad-ravoof
@mohammad-ravoof 11 ай бұрын
Thanks alot hitesh.
@subuhifarooqui5165
@subuhifarooqui5165 9 ай бұрын
Thanks 🙏🙏🙏🙏
@rishabhraj1208
@rishabhraj1208 Жыл бұрын
great explanation
@ThotaSrinath
@ThotaSrinath 4 ай бұрын
Thank you so much Bro.
@olukayodepaul7070
@olukayodepaul7070 10 ай бұрын
nice work. pls what is the name of the plugin you said you install that help you design faster?
@shreeshiva4341
@shreeshiva4341 5 ай бұрын
Great video, thankyou
@003_abhishekdubey4
@003_abhishekdubey4 11 ай бұрын
Great Sir
@SUGANTHT-t9y
@SUGANTHT-t9y 9 ай бұрын
thank u its very useful!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@pradeep6635
@pradeep6635 3 ай бұрын
thank you❣
@sankalpgupta8917
@sankalpgupta8917 Жыл бұрын
sir really like your theme #chaiTheme
@akashmatsagar9970
@akashmatsagar9970 Жыл бұрын
Thank you
@erbhargavvyas
@erbhargavvyas 5 ай бұрын
Why to use ? We could have just button and the onlcick event on that button when we do not want to actully submit. Any explaination, that why people (I have seen at many places) uses the and then use the prevent default, would be appriciated.
@Zara.Khurram
@Zara.Khurram 10 ай бұрын
Thank you for creating such great content. I am trying to learn coding by watching your videos. Quick question: I followed all the steps but in the currency converter I made I am unable to change the input Amount. what can I do to solve it? I will really appreciate your help.
@anthonynnawulezi7400
@anthonynnawulezi7400 6 ай бұрын
Please i want to know what plugin do you use to suggest codes I kind of like it
@_sarthakmisal
@_sarthakmisal Жыл бұрын
Hitesh bhai Chai aur code pe aapne direct code likha hai toh samza nahi issi liye yaha aaya hu Hope that won't get disappointed this time
@prasantht.k8345
@prasantht.k8345 3 ай бұрын
Thank you sir
@thearmanahmed_
@thearmanahmed_ Жыл бұрын
thanks hitesh
@saisashreek9249
@saisashreek9249 8 ай бұрын
Hey hitesh curency converter API link failed.
@rdakash-1108
@rdakash-1108 Жыл бұрын
Thanks for the informative project Hitesh. I faced one problem which is, the To values remains while swapping. After hours of debugging found that the problem is in convert function. The value actually got swapped for a split second after which Convert function runs again with the updated amount but with old currencyInfo. Please comment if someone fixed this :) Edit: Having convert function on onClick event of convert button instead of form's onSubmit fixed it.
@MonishaBaskaraRao
@MonishaBaskaraRao Жыл бұрын
Thanks a lot! Saved time!
@lcandao8660
@lcandao8660 Жыл бұрын
After hours of looking as well, I finally figured out what was causing the issue. Since this is all happening in a we define the type for our 'Convert' button as "submit". We never set a type for our 'Swap' button and so it takes it by default as a form submit. By setting the type="button" for my 'Swap button, I'm able to successfully swap the amounts.
@akashsaxena7339
@akashsaxena7339 11 ай бұрын
@@lcandao8660 can you tell the steps you used to debug this
@mattakalyan1427
@mattakalyan1427 Жыл бұрын
Thanks a lot
@deadlylive_gaming7154
@deadlylive_gaming7154 4 ай бұрын
thanks🎉
@barnamoydhar4507
@barnamoydhar4507 Ай бұрын
Love you hiteshsir
@AashutoshSingh-xq7gy
@AashutoshSingh-xq7gy 8 ай бұрын
Thank you very much sir
@huletech
@huletech Жыл бұрын
hey hitesh can you make tutorial on how to use react js with postgresql
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
How to use reactjs with postgresql ?
@huletech
@huletech Жыл бұрын
I watched the video thank you for your response sir
@erbhargavvyas
@erbhargavvyas 5 ай бұрын
The useId will resolve the issue two developer giving same name for two different things specially in larg scal project where multiple developers are working on components that will appear on a same screen.
@MILDTALK
@MILDTALK Жыл бұрын
Hi Hitesh, I have a doubt like you have swapped from and to value without using any third variable. So my question is 1. setFrom(to) 2. setTo(from) As soon as line 1 runs, its value is changed . How does it preserve its previous value? How is it working?? Any concept I am missing ? Pls suggest me.
@lcandao8660
@lcandao8660 Жыл бұрын
From my understanding, he explained this in his video "Why you need hooks and project", using the counter project. In react, when you call a function, if you want it to change the value in real time, you must use a callback that forces it to wait for the value change. Otherwise, it does batch operations and applies the changes at the end of the function call. In this case, since it's a batch operation, setFrom() and setTo() don't have their values changed until the end, in which case they're effectively swapped. This is my understanding from studying his videos, I hope it helps!
@tGoldenPhoenix
@tGoldenPhoenix Ай бұрын
❤❤❤
@anthonynnawulezi7400
@anthonynnawulezi7400 6 ай бұрын
thank you for this
@saikalyan-v3c
@saikalyan-v3c Жыл бұрын
Thanks
@ameertheeink
@ameertheeink 4 ай бұрын
Thankyou
@prashanthkumar7610
@prashanthkumar7610 8 ай бұрын
Thank you so much
@SecondId-x9p
@SecondId-x9p 10 ай бұрын
thank u sir
@deepeshpakhare
@deepeshpakhare Жыл бұрын
Thanks for another great video. Learnt a lot. Can we now delve into testing react components with you ?
@SadhviKesarwani
@SadhviKesarwani 6 ай бұрын
can you send me API link
@himanshusingh7636
@himanshusingh7636 6 ай бұрын
❤❤❤❤
@anandj3616
@anandj3616 Жыл бұрын
please do javascript series in english too
@manoyal
@manoyal Жыл бұрын
The only thing left that I want to understand is to be able to use the useReducer hook, together with useEffect hook to do state management without relying on external libraries like Redux
@lionfamily9374
@lionfamily9374 7 ай бұрын
Thank you
@mrinalbera6080
@mrinalbera6080 Жыл бұрын
Hello sir, pranam. Sir I want to do your node js backend course from learn code from me website is that course sufficient for backend learning? In ineuron it's same topics videos but price is much high why sir? If you cleary doubt it will very grateful ❤
@thummanapallishivakumar6590
@thummanapallishivakumar6590 5 күн бұрын
❤‍🔥
@akashrathod2285
@akashrathod2285 15 күн бұрын
where i can get this project code?
@marisankarm58
@marisankarm58 6 ай бұрын
I learned a lot in this video
@OOO-CM-DVinay
@OOO-CM-DVinay 7 ай бұрын
hey bro i have used the url provided by you in github but still the the url is not working i am not getting any type of data from the url
@kevinbiwott9301
@kevinbiwott9301 7 ай бұрын
Thanks
@ruxisama7473
@ruxisama7473 Жыл бұрын
Thanks
@kjorator
@kjorator 7 ай бұрын
thanku
@shyamnarayananj4480
@shyamnarayananj4480 6 ай бұрын
Objects are not valid as a React child (found: object with keys {label, amount, currencyOptions, onCurrencyChange, onAmountChange, selectedCurrency}). If you meant to render a collection of children, use an array instead struck by an error while running this program. Someone plz correct me..
@juanmacias5922
@juanmacias5922 Жыл бұрын
51:20 somehow my swap function isn't setting the correct setConvertedAmount(amount), just stays as the old convertedAmount. xD even tried using temp values, I'm just going to walk away for now lol thanks for the video!
@dhruvcharkhawala7509
@dhruvcharkhawala7509 Жыл бұрын
yes mine also ping here if you find the solution
@amritajain9664
@amritajain9664 Жыл бұрын
Gained some valuable knowledge
@kazitanim007
@kazitanim007 9 ай бұрын
This currency api link is not valid anymore, please update.
@salmanfarshisajib6512
@salmanfarshisajib6512 Жыл бұрын
❤👍
@tanyamaurya9626
@tanyamaurya9626 Жыл бұрын
Hello sir, I’ve been trying to access this course of Mern stack on your site but somehow it’s showing sorry for the inconvenience, contact admin.. I’ve already bought this course 2 months back. Could you please let us know by when the issue will be resolved?
@awnishprasad9367
@awnishprasad9367 Жыл бұрын
from where i get those api
@GiorgiKhvedelidze-j2e
@GiorgiKhvedelidze-j2e 11 ай бұрын
👍
@NitishJain-ww2fv
@NitishJain-ww2fv Жыл бұрын
hey hitesh, the "To" value is not getting updated with Swap function. I tried saving the values in const befor setting in "setXXXX" but no luck. The Fetch API call is happening twice on page load. I tried to debug a lot but couldn't able to found the reason. Any suggestion?
@lcandao8660
@lcandao8660 Жыл бұрын
After hours of looking as well, I finally figured out what was causing the issue. Since this is all happening in a we define the type for our 'Convert' button as "submit". We never set a type for our 'Swap' button and so it takes it by default as a form submit. By setting the type="button" for my 'Swap button, I'm able to successfully swap the amounts. Hope this helps.
@Adventures_English
@Adventures_English Жыл бұрын
@@lcandao8660 Thanks so much for putting the time in to figure this out. That isn't an obvious solution to me at this point. Mind sharing how you figured it out?
@Adventures_English
@Adventures_English Жыл бұрын
@@lcandao8660 FROM MDN type The type of the button. Possible values are: submit: The button submits the form data to the server. This is the default if the attribute is not specified, or if the attribute is dynamically changed to an empty or invalid value. reset: The button resets all the controls to their initial values. button: The button has no default behavior. It can have client-side scripts associated with the element's events, which are triggered when the events occur.
@lcandao8660
@lcandao8660 Жыл бұрын
I haven't looked at the code in several weeks, but I can go through my thought process from what I recall. I debugged the problem with several breakpoints within the swap function call. I looked at the value going in and what would come out. I noticed when slowed down, the function call would effectively swap but immediately swap again. This would cause my "To" and "From" values to be identical. After a while of staring at code, I noticed there was no type assigned to the "Swap" button. but there is a type assigned to "Convert" button. Then I started to experiment with eliminating the form template and just running the buttons alone. This didn't work, so the last thought I had was "what if this button is submitting the form?". That is when I input the type and it solved my problem@@Adventures_English
@WriterMackey
@WriterMackey 3 ай бұрын
Where the link to github, Where can i trace it? Very urgent
@madhummh77
@madhummh77 Жыл бұрын
@JyotiYadav-o3l
@JyotiYadav-o3l Жыл бұрын
How to run this project ?
@sharathkumar726
@sharathkumar726 10 ай бұрын
🥶
React router crash course
55:54
Hitesh Choudhary
Рет қаралды 45 М.
useEffect, useRef and useCallback with 1 project in Reactjs
40:18
Hitesh Choudhary
Рет қаралды 30 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 30 МЛН
So Cute 🥰 who is better?
00:15
dednahype
Рет қаралды 19 МЛН
Building a react project | bgChanger
17:47
Hitesh Choudhary
Рет қаралды 18 М.
Custom Hooks in React (Design Patterns)
12:56
Cosden Solutions
Рет қаралды 61 М.
React VS Svelte...10 Examples
8:35
Beyond Fireship
Рет қаралды 606 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
Context API in react | get the concept
29:00
Hitesh Choudhary
Рет қаралды 78 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 499 М.
Build a dark mode light mode in reactjs with context api
29:20
Hitesh Choudhary
Рет қаралды 36 М.
This UI component library is mind-blowing
8:23
Beyond Fireship
Рет қаралды 749 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 962 М.
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН