Custom hooks in react | currency Project

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ก.ย. 2024
  • 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...

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

  • @akashmatsagar9970
    @akashmatsagar9970 11 หลายเดือนก่อน +9

    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 11 หลายเดือนก่อน +2

      Fr? Is it his first job?

    • @akashmatsagar9970
      @akashmatsagar9970 11 หลายเดือนก่อน +1

      Yes his starting actually half of above but within six months he is at above in same company@@HrissW

    • @_sarthakmisal
      @_sarthakmisal 7 หลายเดือนก่อน

      Naah bruh ​@@HrissW

    • @Nomadic_picxoman
      @Nomadic_picxoman หลายเดือนก่อน

      Course link

  • @vedantdeshpande2723
    @vedantdeshpande2723 7 หลายเดือนก่อน +3

    Really thank you this is one of the best react series I have watched and really appreciate your hard work man

  • @loudcapricorn5513
    @loudcapricorn5513 5 หลายเดือนก่อน +1

    This was a really great video providing deep learning which is actually asked in interviews.
    Thank you for this wonderful content

  • @christophermawela3318
    @christophermawela3318 25 วันที่ผ่านมา +1

    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

  • @lcandao8660
    @lcandao8660 10 หลายเดือนก่อน +1

    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 8 หลายเดือนก่อน +1

      from where i get those api

  • @utkarshgb27
    @utkarshgb27 หลายเดือนก่อน

    Thank you so much, Hitesh Choudhary sir, for the incredible React tutorial! It's by far the best one I've seen on TH-cam and has made my React journey so much easier. I’m starting to believe that I can truly learn React thanks to your guidance!

  • @ItsjustStarFoxNBD
    @ItsjustStarFoxNBD 6 หลายเดือนก่อน +2

    Hitesh your videos are incredible. Thank you so much!

  • @erbhargavvyas
    @erbhargavvyas 6 วันที่ผ่านมา

    Thanks for the Awesome tutorial.

  • @jesarmarcin1149
    @jesarmarcin1149 10 หลายเดือนก่อน +1

    Hello Hitesh
    I just want to thank you for this series coz it has helped me alot

  • @zues8150
    @zues8150 หลายเดือนก่อน

    Great Project Sir even i have completed more complex project on react but this one was just perfect that's it 🔥

  • @kattamurinagabhushan9879
    @kattamurinagabhushan9879 5 หลายเดือนก่อน

    i just love to watch your tutorials. Learning a lot of courses from you. Thankyou for your efforts.

  • @aniket7390
    @aniket7390 9 หลายเดือนก่อน +4

    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 6 หลายเดือนก่อน

      did you face issue while fetching the data from api? if not, can you please help?

    • @PranayAcharya-qz6tf
      @PranayAcharya-qz6tf 17 วันที่ผ่านมา

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

  • @sharathkumar726
    @sharathkumar726 5 หลายเดือนก่อน

    You are amazing teaching skills with great attitude....👍

  • @aimenazim1508
    @aimenazim1508 หลายเดือนก่อน

    Well, I must say I learn quite a lot, I was scared of custom hooks I never touched I but I'm confident now.

  • @rakteemmullick2908
    @rakteemmullick2908 5 หลายเดือนก่อน

    thank you very much sir for such an amazing tutorial. Especially the concept of hooks got much more clearer to me.

  • @brunohenrard
    @brunohenrard 3 หลายเดือนก่อน

    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 7 หลายเดือนก่อน +1

    Thank you so much Hitesh,
    as usual your teaching is top notch.

  • @ritwikyadav9749
    @ritwikyadav9749 7 หลายเดือนก่อน

    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.

  • @mahendrarajput2870
    @mahendrarajput2870 6 หลายเดือนก่อน +1

    thank brother for sharing content.

  • @youtubecodinggithub6145
    @youtubecodinggithub6145 3 หลายเดือนก่อน

    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 😍

  • @souvikdas_01
    @souvikdas_01 2 หลายเดือนก่อน

    Thank you sir for such an amazing react content.

  • @Donald.L.Rosenberg
    @Donald.L.Rosenberg 3 หลายเดือนก่อน

    Hitesh your videos are incredible. Thank you so much!

  • @pawankand
    @pawankand 11 หลายเดือนก่อน

    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 :-)

  • @Adventures_English
    @Adventures_English 8 หลายเดือนก่อน +1

    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.

  • @user-kk1vu9tz8g
    @user-kk1vu9tz8g 11 หลายเดือนก่อน

    You give me so much positive energy. Blieve me, this has equal important to information itself

  • @Adventures_English
    @Adventures_English 8 หลายเดือนก่อน

    Another great video. Thanks again! You are a great teacher!

  • @devaprem7777
    @devaprem7777 10 หลายเดือนก่อน

    IT HELPS ME A LOT TO GO THOUGHT THE CONCEPTS BRO... THANKS A LOT

  • @iBounty12
    @iBounty12 7 หลายเดือนก่อน

    really good project with lot to learn from it, thanks

  • @ravisankarp61
    @ravisankarp61 11 หลายเดือนก่อน

    ​Thank you so much, this video has helped a lot and I have learned a lot .Will watch more videos on ur channel.

  • @erbhargavvyas
    @erbhargavvyas 6 วันที่ผ่านมา

    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.

  • @erbhargavvyas
    @erbhargavvyas 7 วันที่ผ่านมา

    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.

  • @_sarthakmisal
    @_sarthakmisal 7 หลายเดือนก่อน

    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

  • @hajsdusau
    @hajsdusau 4 หลายเดือนก่อน

    Great Video Hitesh!

  • @divinendubuisi9593
    @divinendubuisi9593 10 หลายเดือนก่อน

    thank you for the project, a lot was learned. I really appreciate

  • @Zara.Khurram
    @Zara.Khurram 5 หลายเดือนก่อน

    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.

  • @ChandanSahu-ub8mp
    @ChandanSahu-ub8mp 2 หลายเดือนก่อน

    Really helpful video. Loved it❤

  • @shreeshiva4341
    @shreeshiva4341 15 วันที่ผ่านมา

    Great video, thankyou

  • @manjuhakki5635
    @manjuhakki5635 10 หลายเดือนก่อน

    Nice video. Keep doing it consistently.

  • @ChetnaAglawe
    @ChetnaAglawe 6 หลายเดือนก่อน

    Thank you so much ,great learning video, help a lot.

  • @purvesh62
    @purvesh62 10 หลายเดือนก่อน

    Thank you for another informative video.

  • @achuthanboovaragan3546
    @achuthanboovaragan3546 9 หลายเดือนก่อน

    Learnt about custom hooks clearly. Thank you!!

  • @saisashreek9249
    @saisashreek9249 3 หลายเดือนก่อน +3

    Hey hitesh curency converter API link failed.

  • @morecoinbull
    @morecoinbull 9 หลายเดือนก่อน

    thanks for making these. they are really helpful!!

  • @NikhilGupta-qn8jl
    @NikhilGupta-qn8jl 4 หลายเดือนก่อน

    Thanks for amazing content.

  • @akashmatsagar9970
    @akashmatsagar9970 11 หลายเดือนก่อน +1

    Thank you

  • @prasadpatil2371
    @prasadpatil2371 11 หลายเดือนก่อน

    Absolutely enjoyed the latest video! Gained some valuable knowledge-thanks a bunch!

  • @user-gr5yn9xo5r
    @user-gr5yn9xo5r 4 หลายเดือนก่อน

    thank u its very useful!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @mohammad-ravoof
    @mohammad-ravoof 6 หลายเดือนก่อน

    Thanks alot hitesh.

  • @sankalpgupta8917
    @sankalpgupta8917 8 หลายเดือนก่อน +1

    sir really like your theme #chaiTheme

  • @Ronieyit
    @Ronieyit หลายเดือนก่อน

    best of the best. thanks Mr. Hitesh

  • @AashutoshSingh-xq7gy
    @AashutoshSingh-xq7gy 3 หลายเดือนก่อน

    Thank you very much sir

  • @subuhifarooqui5165
    @subuhifarooqui5165 4 หลายเดือนก่อน

    Thanks 🙏🙏🙏🙏

  • @manoyal
    @manoyal 11 หลายเดือนก่อน

    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

  • @deenuakash6652
    @deenuakash6652 10 หลายเดือนก่อน +4

    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.

    • @user-wr8lp8ou6t
      @user-wr8lp8ou6t 10 หลายเดือนก่อน +2

      Thanks a lot! Saved time!

    • @lcandao8660
      @lcandao8660 9 หลายเดือนก่อน +3

      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 6 หลายเดือนก่อน

      @@lcandao8660 can you tell the steps you used to debug this

  • @rishabhraj1208
    @rishabhraj1208 8 หลายเดือนก่อน

    great explanation

  • @003_abhishekdubey4
    @003_abhishekdubey4 6 หลายเดือนก่อน

    Great Sir

  • @MILDTALK
    @MILDTALK 10 หลายเดือนก่อน +1

    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 10 หลายเดือนก่อน

      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!

  • @thearmanahmed_
    @thearmanahmed_ 10 หลายเดือนก่อน

    thanks hitesh

  • @olukayodepaul7070
    @olukayodepaul7070 5 หลายเดือนก่อน

    nice work. pls what is the name of the plugin you said you install that help you design faster?

  • @dolfieaspeling9893
    @dolfieaspeling9893 8 หลายเดือนก่อน

    Another banger , keep them coming :)

  • @huletech
    @huletech 11 หลายเดือนก่อน +2

    hey hitesh can you make tutorial on how to use react js with postgresql

    • @HiteshCodeLab
      @HiteshCodeLab  11 หลายเดือนก่อน +5

      How to use reactjs with postgresql ?

    • @huletech
      @huletech 11 หลายเดือนก่อน +1

      I watched the video thank you for your response sir

  • @deepeshpakhare
    @deepeshpakhare 11 หลายเดือนก่อน

    Thanks for another great video. Learnt a lot. Can we now delve into testing react components with you ?

    • @SadhviKesarwani
      @SadhviKesarwani หลายเดือนก่อน

      can you send me API link

  • @anandj3616
    @anandj3616 11 หลายเดือนก่อน

    please do javascript series in english too

  • @anthonynnawulezi7400
    @anthonynnawulezi7400 หลายเดือนก่อน

    thank you for this

  • @prashanthkumar7610
    @prashanthkumar7610 3 หลายเดือนก่อน

    Thank you so much

  • @mattakalyan1427
    @mattakalyan1427 8 หลายเดือนก่อน

    Thanks a lot

  • @lionfamily9374
    @lionfamily9374 2 หลายเดือนก่อน

    Thank you

  • @kevinbiwott9301
    @kevinbiwott9301 2 หลายเดือนก่อน

    Thanks

  • @marisankarm58
    @marisankarm58 หลายเดือนก่อน

    I learned a lot in this video

  • @kjorator
    @kjorator หลายเดือนก่อน

    thanku

  • @user-py8ub6jk1f
    @user-py8ub6jk1f 5 หลายเดือนก่อน

    thank u sir

  • @anthonynnawulezi7400
    @anthonynnawulezi7400 หลายเดือนก่อน

    Please i want to know what plugin do you use to suggest codes
    I kind of like it

  • @user-rv2vs3kx1u
    @user-rv2vs3kx1u 9 หลายเดือนก่อน

    Thanks

  • @juanmacias5922
    @juanmacias5922 11 หลายเดือนก่อน +1

    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 8 หลายเดือนก่อน

      yes mine also ping here if you find the solution

  • @ruxisama7473
    @ruxisama7473 7 หลายเดือนก่อน

    Thanks

  • @shyamnarayananj4480
    @shyamnarayananj4480 หลายเดือนก่อน

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

  • @joelfoka
    @joelfoka 6 หลายเดือนก่อน +2

    It seems that this API no longer works

  • @himanshusingh7636
    @himanshusingh7636 หลายเดือนก่อน

    ❤❤❤❤

  • @user-bj7nh9kx1g
    @user-bj7nh9kx1g 6 หลายเดือนก่อน

    👍

  • @kazitanim007
    @kazitanim007 3 หลายเดือนก่อน +1

    This currency api link is not valid anymore, please update.

  • @mrinalbera6080
    @mrinalbera6080 11 หลายเดือนก่อน

    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 ❤

  • @sharathkumar726
    @sharathkumar726 5 หลายเดือนก่อน

    🥶

  • @OOO-CM-DVinay
    @OOO-CM-DVinay 2 หลายเดือนก่อน

    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

  • @oneway4370
    @oneway4370 11 หลายเดือนก่อน

    Sir ji explain super keyword please

  • @tanyamaurya9626
    @tanyamaurya9626 11 หลายเดือนก่อน

    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?

  • @salmanfarshisajib6512
    @salmanfarshisajib6512 7 หลายเดือนก่อน

    ❤👍

  • @madhummh77
    @madhummh77 11 หลายเดือนก่อน

  • @awnishprasad9367
    @awnishprasad9367 8 หลายเดือนก่อน

    from where i get those api

  • @neendaari
    @neendaari 4 หลายเดือนก่อน

    My currency type button is not working anyone have solution of when i clicked that button that button don't show any name just print all countries value in console

  • @sandhiyasandhiya1603
    @sandhiyasandhiya1603 11 หลายเดือนก่อน +1

    I have paid Rs.700 for your complete python course.But actually it's not working for the past two days. The message is displayed as your session is logged out. But i have paid 700 just 2 weeks ago.. And it is valid for more than 1 yr.. I want to know why I can't login to my account

    • @tanyamaurya9626
      @tanyamaurya9626 11 หลายเดือนก่อน

      Yes correct, it's showing contact to admin..

    • @user-rj9im3lp3y
      @user-rj9im3lp3y 11 หลายเดือนก่อน

      @sandhiyasandhiya1603 are you able to login now?

  • @muthugokul8785
    @muthugokul8785 22 วันที่ผ่านมา

    Everthing is Fine But Api You Provided was Not Having Any data currently

  • @NitishJain-ww2fv
    @NitishJain-ww2fv 11 หลายเดือนก่อน

    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 9 หลายเดือนก่อน +2

      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 8 หลายเดือนก่อน

      @@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 8 หลายเดือนก่อน

      @@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 7 หลายเดือนก่อน

      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

  • @user-bg5hw8jp1o
    @user-bg5hw8jp1o 10 หลายเดือนก่อน

    How to run this project ?

  • @joynikub6216
    @joynikub6216 4 หลายเดือนก่อน +2

    Not at all fun boss. in this video it feels like you have the curse of knowledge.
    You do stuff as if we already know what you are doing but we dont. to watch your 1 hour video, we have to keep looking for stuff on internet for 2 days

  • @tanyamaurya9626
    @tanyamaurya9626 10 หลายเดือนก่อน

    Sir, the ineuron team is not granting us the access to our LCO courses. Instead, they are issuing refunds for the amount we initially paid for the course on LCO.
    I purchased a course from LCO for 300 rupees and now they are offering the same course on their site at 25,000 rupees!
    Sir kindly provide us the access so that we can continue our learnings from where we are made to left off!
    Is there anyone else who is having the same issue of accessing LCO courses? Please reply to this text

  • @Adventures_English
    @Adventures_English 8 หลายเดือนก่อน

    BTW if you are actually trying to build a currency converter consider looking for a better API. This one is not accurate in a lot of case. For example, the Peruvian sol it get wrong by orders of magnitude.

  • @kannusingh8059
    @kannusingh8059 5 หลายเดือนก่อน

    hey where is helper file buddy

  • @jatinudasi5056
    @jatinudasi5056 4 หลายเดือนก่อน

    the api has stopped working. i am getting the error

  • @NiteshKumar-of3is
    @NiteshKumar-of3is 5 หลายเดือนก่อน

    Bro Hindi me bhi bat kar lo

  • @sushantjadhav7272
    @sushantjadhav7272 2 หลายเดือนก่อน

    plz give an api