useEffect, useRef and useCallback with 1 project in Reactjs

  Рет қаралды 30,622

Hitesh Choudhary

Hitesh Choudhary

Күн бұрын

In this video, Hitesh walks you through the practical use of ReactJS hooks like useEffect, useRef, and useCallback by building a simple yet insightful project-a password generator. Despite the project’s basic appearance, it’s designed to demonstrate ReactJS best practices, focusing on optimizing component re-rendering and enhancing user experience. Hitesh explains how useEffect runs code on component mount and re-runs when dependencies change, ensuring the password updates dynamically. The useRef hook is utilized to reference and manipulate DOM elements, such as highlighting text when copying. Additionally, useCallback is introduced to optimize performance by caching function definitions, preventing unnecessary re-renders. This project, built using Tailwind CSS for styling, is an excellent example of how even a simple ReactJS application can involve complex, efficient coding techniques. Throughout the video, Hitesh emphasizes the importance of understanding these hooks to write cleaner, more efficient React code, making it a must-watch for anyone looking to deepen their ReactJS knowledge.
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...

Пікірлер: 160
@atishbackup9442
@atishbackup9442 Жыл бұрын
What a way to explain things even after working 8 years in industry i find lot of point to pick and dig dive thanks HItesh SUperman
@Noouurra
@Noouurra 11 ай бұрын
thank you what a beautiful way to deal with React I loved it. man I do not feel time with you this is an amazing series to learn with thanks again
@benmorgan-cleveland2446
@benmorgan-cleveland2446 11 ай бұрын
Hitesh, I love the tutorials! Clear, current, and easy to listen to and follow. Well done.
@SrinivasBareddy
@SrinivasBareddy 5 күн бұрын
Thank you Hitesh. Loved the way you are explaining the things...
@Maniish.pandey
@Maniish.pandey Жыл бұрын
I actually was studying from chai and react and i came here to revise the videos that I've studied😅, and these videos actually helped me understanding concept more.
@АлександрРевин-ъ8к
@АлександрРевин-ъ8к Жыл бұрын
Hey Hitesh! You are the best speaker about programming that I've ever watched and listened. Thank you very much
@golubhattuk01
@golubhattuk01 Ай бұрын
your single video cleared my all doubts about hooks
@Ronieyit
@Ronieyit 6 ай бұрын
this tutorial series is the best l have found on React. thank you so much Mr. Hitesh. BUG: Sir - there are instances the password generated is less than the length specified, it still displays for the user the password however it is shorter than the user selection. work around l used is to use an if statement to compare the length of the password generated against the "length" required, if they are not equal re-run the "for loop", l created a function for the "for loop" to ensure for loop is not repeated. thank you once again
@vijayroy93
@vijayroy93 Жыл бұрын
you are the best Hitesh. your teaching style is just out of this world and simple.
@duanedodson1
@duanedodson1 Жыл бұрын
Thank you, again, this series has driven home so many of the skills I have been struggling with in react, thank you.
@loudcapricorn5513
@loudcapricorn5513 10 ай бұрын
Great video. Simple and easy with that explananation
@sriyasuhrudi9438
@sriyasuhrudi9438 5 ай бұрын
This series is the best for beginners trying to learn react. You make it sound interesting and easy to learn. Thank you Hitesh sir
@martinnjeri6997
@martinnjeri6997 6 ай бұрын
THis is the most valiable 40 minutes video i have watched in a while...good job!!!!
@ketanjadhav4328
@ketanjadhav4328 28 күн бұрын
Bhai Hindi channel se aaya hu and after watching your videos here Sir you I have become a Fan 😊
@somaadina8102
@somaadina8102 Жыл бұрын
This is one of the best react series on yt❤
@animeshsingh1605
@animeshsingh1605 Жыл бұрын
The way you help us make to understand concept in JavaScript , is superb.
@joelhenry2203
@joelhenry2203 Жыл бұрын
thank you hitesh for this series. please continue this as long as as you can. Im learining a lot from this.
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
Yep, we will be building some cool mega project too in this series
@kashishagrahari7087
@kashishagrahari7087 Жыл бұрын
Hey Hitesh! It was a wonderful, easy to understand, basic to detail, everything you have covered in this video🤩 Thank you so much for creating and updating such contents. Keep Going 🤓
@abhishektiwari8431
@abhishektiwari8431 10 ай бұрын
Thank you hitesh for this series really i am enjoying this playlist and building a frontend project from scratch
@need_2_know
@need_2_know Жыл бұрын
Thank You sir ..❤ i came here after watching 3 hrs video on another channel.
@dipakchavare778
@dipakchavare778 Жыл бұрын
thank you Hitesh sir for this series.. Im learining a lot from this.
@abinasb
@abinasb Жыл бұрын
Thank you for sharing this video series which helps so much for learning react from scratch
@Adventures_English
@Adventures_English Жыл бұрын
Great Project. Great Attitude. Great UI.
@suryakumar7285
@suryakumar7285 Жыл бұрын
Thank you for this course sir , please continue this series as long as you can. ❤
@FaizanKhan-gfaizank
@FaizanKhan-gfaizank Жыл бұрын
Anyone watching this, just know that you in the right place..
@bhavikarathod2417
@bhavikarathod2417 8 ай бұрын
if i will complete this series will I be able to crack the interviews?
@umarxaman7761
@umarxaman7761 11 ай бұрын
real hero in development
@sumontasaha5638
@sumontasaha5638 Жыл бұрын
Thank you for the Quality of teaching, Sir
@vishwanatha6859
@vishwanatha6859 11 ай бұрын
Amazing video, learnt a lot of things, Thank you so much Sir🤩
@NikhilHedukar
@NikhilHedukar Жыл бұрын
You are doing really good work. Your videos are always helpful for me. Thanks Hitesh 👍
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
Glad to hear that
@towseefahmed6328
@towseefahmed6328 Жыл бұрын
very much interested sir... thanks so much for this series it help us a lot in our projects
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
You are most welcome
@Donald.L.Rosenberg
@Donald.L.Rosenberg 8 ай бұрын
thank you what a beautiful way to deal with React I loved it.
@DarthVader-z2s
@DarthVader-z2s Жыл бұрын
Thanks, Hitesh. In general, I wouldn't comment, but I want you to make such more videos, hence I'm on it for your morale. Cheers.
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
Thanks a ton
@haque259
@haque259 11 ай бұрын
Your videos are best so far
@PranavPatil-e6l
@PranavPatil-e6l Жыл бұрын
Your videos are always helpful for me.
@lasagna2240
@lasagna2240 8 ай бұрын
Thank you for the series!
@TVCeker
@TVCeker Жыл бұрын
Thank you for your free educational video.
@madhummh77
@madhummh77 Жыл бұрын
Great effort towards quality of teaching
@animeshmondal9569
@animeshmondal9569 Жыл бұрын
Thank you sir for this course❤❤
@martinnjeri6997
@martinnjeri6997 6 ай бұрын
Vamossss...... you are an inspiration to many... bravooo 💪🏿💪🏿💪🏿💪🏿💪🏿💪🏿💪🏿💪🏿
@lenny_off9723
@lenny_off9723 Жыл бұрын
Hi , thanks for your tutos , very interesting and helping a lot. Juste a comment to tel you that there has been a small mistake in your code (nothing to bad). In the "for loop" you wrote "i
@brianjones71
@brianjones71 4 ай бұрын
right, or start the loop at 0
@irtizahussain7164
@irtizahussain7164 Жыл бұрын
Great work, appreciated. 😃
@DriveDiveAroundtheWorld
@DriveDiveAroundtheWorld Жыл бұрын
Thanks for this course and your work on this.
@mattakalyan1427
@mattakalyan1427 Жыл бұрын
Thanks for giving this nice course
@aaronmanocha9158
@aaronmanocha9158 6 ай бұрын
Thank You sir, you are doing a great work!!!!
@SMSHIHAB
@SMSHIHAB Жыл бұрын
Really helpful series for learning to react
@nigam_sharma
@nigam_sharma Жыл бұрын
From chai and code ❤
@jagadeeshp1163
@jagadeeshp1163 17 күн бұрын
Guys give this guy a crown :))
@tairouthecreator2196
@tairouthecreator2196 3 ай бұрын
i love that one
@suvrajitmondal2325
@suvrajitmondal2325 Жыл бұрын
Thank you. Very useful video.
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
You are welcome!
@Bhaskarjyoti02
@Bhaskarjyoti02 10 ай бұрын
Im very much thankful to you sir
@letshope5646
@letshope5646 Жыл бұрын
Thanks Hitesh...
@mobileLegendFunMoments
@mobileLegendFunMoments Жыл бұрын
Sir keep it up , i am following your both channels.
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
Keep watching
@jun4idm0min
@jun4idm0min Жыл бұрын
Hitesh brother 💐💐
@_sarthakmisal
@_sarthakmisal Жыл бұрын
100th Comment Hitesh Bhai
@frankjonathansaenz1911
@frankjonathansaenz1911 5 ай бұрын
Great tutorial!!
@prasadpatil2371
@prasadpatil2371 Жыл бұрын
there is problem in for loop , hence i tried - for (let i = 1; i < length; i++) { const i = Math.floor(Math.random() * str.length + 1) pass += str.charAt(i) }
@sivasaireddy1601
@sivasaireddy1601 10 ай бұрын
great Hitesh
@murshid956
@murshid956 Жыл бұрын
Thank you so much for this video
@morecoinbull
@morecoinbull Жыл бұрын
Keep going Bro! Great Job
@chillappreciator885
@chillappreciator885 4 күн бұрын
Thanks for the video, I learned a lot. But I really miss the github link to the repo of this course with the branch for this specific video. So that I can watch the video to the end, then open an editor and implement the project myself using your github repo as a cheat sheet. Currently we need to use the video itself without an ability to see the other files.
@mahendrarajput2870
@mahendrarajput2870 Жыл бұрын
Nice explanation.
@aimenazim1508
@aimenazim1508 6 ай бұрын
quite informative video learnt a lot in it. one little confusion, i did not get why we used "usecallbak" when "use effect" is doing the same thing.
@Hatsoff4u
@Hatsoff4u Жыл бұрын
its really awesome
@abhiramkasturi6823
@abhiramkasturi6823 3 ай бұрын
Great video but I did not understand why we need to use useCallback for generatePassword function. Since it is tied to useEffect, wont the function be recreated anyway? Please correct me if I am wrong. Thank you.
@nasrinagashte
@nasrinagashte Жыл бұрын
Thanks 😊
@vijay-dw1bl
@vijay-dw1bl Жыл бұрын
Nice work bro
@GOKKULVSIT
@GOKKULVSIT Жыл бұрын
great work
@jayakumar9976
@jayakumar9976 Жыл бұрын
Awesome. Learned about usecallback hook.
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
Glad it was helpful!
@DeepakSankhyan
@DeepakSankhyan Жыл бұрын
Why only 100 comments for this quality stuff.....
@dolfieaspeling9893
@dolfieaspeling9893 Жыл бұрын
Please, please keep going !
@henryamos
@henryamos 7 ай бұрын
I love this react coding
@PradeepSharma-ox9mw
@PradeepSharma-ox9mw Жыл бұрын
Hello Sir, Great video, though one query , why we used dependency array on both useeffect and usecallback ?
@bijendernagar15
@bijendernagar15 Жыл бұрын
yes sir sooooo intrestedddddddd
@meowmeowfood
@meowmeowfood Жыл бұрын
Excellent series so far. Just a quick question about the "onChage" method. When you write "onChange = {(e) => setlength(e.target.value)}," how does the javascript know to immediately interpret the "e" as the event? Thanks in advance!
@subbu7512
@subbu7512 Жыл бұрын
The (e) is a shorthand for (event). It's a parameter that represents the event object generated by the browser when the onChange event occurs.Also the way function written here is with implicit arrow functions . Implicit return functions don't require any return keyword . (ES6+ JS Syntax)
@sriramvenkatesh
@sriramvenkatesh Жыл бұрын
Thankyou ji
@navinkumarsahu1159
@navinkumarsahu1159 Жыл бұрын
much needed
@VivoMobile-yg9zh
@VivoMobile-yg9zh 10 ай бұрын
thanks sir
@yashvantryadav
@yashvantryadav Жыл бұрын
Thanks
@miraclemaxwell9988
@miraclemaxwell9988 8 ай бұрын
Thanks Hitesh please can you do something on python. You are the best
@Gamerz-g4i
@Gamerz-g4i Күн бұрын
thanks
@noobCoder26
@noobCoder26 Жыл бұрын
wonderful
@powerfulmath8488
@powerfulmath8488 9 ай бұрын
how are you getting the auto suggestions when you are defining the states?
@sudeepjoshi9948
@sudeepjoshi9948 8 ай бұрын
Intelisense or ai like tabanine, copilot,cody
@deadlylive_gaming7154
@deadlylive_gaming7154 5 ай бұрын
thanks🎉
@ankushchavanwebdeveloper
@ankushchavanwebdeveloper Жыл бұрын
Could you please share which extension you're using to receive auto-suggestions in your code editor?
@arkodeepchatterjee
@arkodeepchatterjee Жыл бұрын
🔥🔥🔥🔥🔥🔥🔥
@Dev.Shoaib
@Dev.Shoaib 2 ай бұрын
Again, no words
@CodeNageShorts
@CodeNageShorts Жыл бұрын
nice
@prateekbidve
@prateekbidve Жыл бұрын
Let's go ❤
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
❤️
@TheCareerGuide601
@TheCareerGuide601 Жыл бұрын
Ey intern hire kr rhe hain? Ey techthon comp sahi hai?
@ajassharafudeen
@ajassharafudeen 7 ай бұрын
guys, what extension prompts vs code to autocomplete useState snippets as shown in 09:40.
@atharvatirkhunde4517
@atharvatirkhunde4517 3 ай бұрын
GitHub copilot
@Arun30802
@Arun30802 2 ай бұрын
It's ai bro may be supermaven pro or some co pilots.. don't use that btw
@viththagan3547
@viththagan3547 Жыл бұрын
Thank you
@HiteshCodeLab
@HiteshCodeLab Жыл бұрын
You're welcome
@SatyamShah-x6d
@SatyamShah-x6d 12 күн бұрын
👍👍👍
@chiranjeev331
@chiranjeev331 Жыл бұрын
Haanji you are back 😅
@_crista
@_crista Жыл бұрын
make more don't stop
@tGoldenPhoenix
@tGoldenPhoenix Ай бұрын
❤❤❤
@The_Developer_
@The_Developer_ Жыл бұрын
we are interested
@gyanabhijeetshivam3692
@gyanabhijeetshivam3692 4 ай бұрын
♥♥♥♥
@dhruvcharkhawala7509
@dhruvcharkhawala7509 Жыл бұрын
generatePassword function is working without useCallback.... why?
@sharathkumar726
@sharathkumar726 10 ай бұрын
👍
@akarshk7518
@akarshk7518 Жыл бұрын
Day 3 of React Journey. 5th video of the day.
Custom hooks in react | currency Project
52:32
Hitesh Choudhary
Рет қаралды 23 М.
🛑LIVE, 11 Feb, 10 PM - TCS NQT 2025 - Preparation Guidance, Queries & Q/A Session by Yash Sir
KG JOB UPDATES & PREP FOR IT by Yash Sir
Рет қаралды 148
A Child's Big Mistake Turned Into an Unforgettable Gift #shorts
00:18
Fabiosa Stories
Рет қаралды 43 МЛН
Когда учитель вышла из класса
00:17
ЛогикЛаб #2
Рет қаралды 2,7 МЛН
14 Context API with local Storage
1:08:19
Hitesh Choudhary
Рет қаралды 16 М.
useRef hook in reactjs | Easiest way
19:44
Hitesh Choudhary
Рет қаралды 86 М.
Learn React Hooks: useCallback - Simply Explained!
17:15
Cosden Solutions
Рет қаралды 119 М.
Tailwind and Props in React JS
26:38
Hitesh Choudhary
Рет қаралды 22 М.
React router crash course
55:54
Hitesh Choudhary
Рет қаралды 45 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 974 М.
Why Signals Are Better Than React Hooks
16:30
Web Dev Simplified
Рет қаралды 500 М.
A Child's Big Mistake Turned Into an Unforgettable Gift #shorts
00:18
Fabiosa Stories
Рет қаралды 43 МЛН