Тёмный

React Hooks in ONE Video 2022 [ EASIEST Explanation ] | React JS Tutorial 

Code Bless You
Подписаться 12 тыс.
Просмотров 75 тыс.
50% 1

🤩Access the Full React Course - www.udemy.com/course/the-ulti...
🗒️MY FAVORITE TOOLS & GEARS
Height Adjustable Desk - amzn.to/42qPZkb
Old Desk in Budget - amzn.to/3UlaFbm
Favorite Laptop - amzn.to/3OrqmKa
LG Monitor for Productivity - amzn.to/3uqA5tv
Silent Keyboard(Loved It) - amzn.to/3UjagGv
Mouse & Keyboard Combo - amzn.to/3Sq50hs
Extra Large Mouse Pad - amzn.to/48Nhcjv
Sony Headphones - amzn.to/3HHjYed
Cheap Earphones for Editing - amzn.to/48eBykN
Daily Use Laptop Stand - amzn.to/3Uj8JQL
Mini Speakers for Consuming Content - amzn.to/48YgAaK
Mport X Connector - amzn.to/3UoHsML
Mic - amzn.to/48eCrtD
3 Color Lightbar - amzn.to/42qgaaW
Dual Monitor Stand - amzn.to/48Nixa1
Stop Watch for Productivity - amzn.to/3Un1RBW
Dotted Diary - amzn.to/3vYBWq1
🚀Access REDUX Course:- www.udemy.com/course/the-ulti...
Learn All React Hooks in One Video. Stating with most popular hook useState and then useEffect, useContext, useRef and much more. After completing this react hooks tutorial, you will ready for apply hooks on your react projects.
UseEffect CHEATSHEET : drive.google.com/file/d/1dko8...
Topics Covered in This Tutorial
- What are hooks? Why we need it?
- useState, useEffect, useContext
- useRef, useReducer, useLayoutEffect
- useMemo, useCallback, Custom hooks
Overview
00:00 Introduction
00:15 What are hooks?
01:16 useState
09:38 useEffect
18:28 useContext
25:30 useRef
32:15 useReducer
39:42 useLayoutEffect
45:10 useMemo
49:59 useCallback
55:07 Custom Hooks
Social Media Links:
🚀COURSES : www.udemy.com/user/code-bless...
🤩INSTAGRAM : / code_blessyou
💙FACEBOOK : / 100077716056158
🐦TWITTER : / code_blessyou
😎LINKEDIN : / code-bless-you-5b76822b
Copyright Clips
Video by Jack Sparrow : www.pexels.com/video/a-man-us...
Video by cottonbro: www.pexels.com/video/congratu...
Video by fauxels: www.pexels.com/video/woman-us...
Tags
react js tutorial,react tutorial,react hooks,usememo,react tutorial for beginners,useref,useeffect react hooks,usereducer,usecontext,usestate react,hooks in react js,hooks react,react hooks tutorial,usecallback,custom hooks react,uselayouteffect,all react hooks,usestate,react js,reactjs,reactjs tutorial,usecallback react hooks,react custom hooks,react js hooks,reactjs hooks,usecontext react hooks,react hooks explained,useEffect,react hook
React Hooks in one video, React hooks crash course, React hooks in one hour, React Hooks tutorial

Опубликовано:

 

29 июн 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 194   
@CodeBlessYou
@CodeBlessYou Год назад
🤩Access the Full React Course - www.udemy.com/course/the-ultimate-react-course-2023-w-real-world-projects/?referralCode=993CD544A6816303D3AD 🚀Access REDUX Course:- www.udemy.com/course/the-ultimate-redux-course-state-management-library/?referralCode=0E6517D629498E1C48D7
@rr2r2r2ra
@rr2r2r2ra Год назад
Just finished it. It was awesome and easy to understand. No information overload. Thank you so much for making edited quick tutorials.
@CodeBlessYou
@CodeBlessYou Год назад
Thanks for your support❤❤❤
@shantanu2322
@shantanu2322 10 месяцев назад
I knew react.js . but after watched you video. I would say that is not true. Mind blowing Explanation in easy words brother very very thank you from deepest of my heart ❤
@CodeBlessYou
@CodeBlessYou 10 месяцев назад
Thank you so much for your feedback. If you like this tutorial, checkout full react course. I just uploaded today❤❤
@shantanu2322
@shantanu2322 10 месяцев назад
@@CodeBlessYou sure brother i will definitely watch
@bilektech9585
@bilektech9585 Год назад
This is by far the best and well explained hooks tutorial have seen on RU-vid.
@CodeBlessYou
@CodeBlessYou Год назад
Thanks for your comment🙌❤
@user-tj5su9xl4q
@user-tj5su9xl4q 4 месяца назад
Downloaded it to watch offline, but the incredible depth brought me back just to hit like and subscribe. 🌟 If I didn't, I'd genuinely regret not supporting a channel that goes above and beyond. Kudos for the fantastic content! 👏
@CodeBlessYou
@CodeBlessYou 4 месяца назад
Thank you so much for this comment. I really really grateful for your love and support❤❤❤
@johnwilson4227
@johnwilson4227 Год назад
The best React hooks' course ever. Thanks a lot.
@CodeBlessYou
@CodeBlessYou Год назад
Thanks for this comment😇❤
@Hacker-ry8iv
@Hacker-ry8iv 10 месяцев назад
Simple,clean & perfect ❤THANK YOU
@CodeBlessYou
@CodeBlessYou 10 месяцев назад
❤❤❤
@kedukhanvilkar5390
@kedukhanvilkar5390 Месяц назад
One of the best video i ever seen on the internet for react hooks. Just watch this video once and understand all hooks. Thanks a lot.
@CodeBlessYou
@CodeBlessYou Месяц назад
❤❤❤
@ragularvind5906
@ragularvind5906 9 месяцев назад
oh man , perfect tutorial that i have been searching for. god bless u ........thankyou so much
@CodeBlessYou
@CodeBlessYou 8 месяцев назад
Glad you liked it!
@pauldipakkr
@pauldipakkr Год назад
I have try to watch hooks in many so called famous educator, but you made this with details that is very good think.. ❤️
@CodeBlessYou
@CodeBlessYou Год назад
Thanks 😀❤
@vinaypatil8009
@vinaypatil8009 Год назад
This is the best video on Hooks. Damn your teaching style is very good and simple. Thanks for your hard work 💪❤️🤠
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for this comment❤
@Jkiddoublenickle
@Jkiddoublenickle Год назад
just finished it , well explained ! thank you
@CodeBlessYou
@CodeBlessYou Год назад
Thanks for watching. Really grateful for that❤❤
@devolajide
@devolajide Год назад
The best useState course I have taken. I have subscribed. Please do more tutorial on building projects for beginners and also simplifying more concepts. Thanks
@CodeBlessYou
@CodeBlessYou Год назад
Sure I will create tutorial on React Beginner Project. Thank you so much for your comment and support. Grateful for that😇❤
@seventyMinus1
@seventyMinus1 Год назад
You are amazing.The way you explain things is so amazing. Thank You.
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for this comment!! It really inspired me for making more tutorials... Grateful for this❤😇
@DhirendraRaushan
@DhirendraRaushan 29 дней назад
It was awesome and easy to understand. Thanks
@CodeBlessYou
@CodeBlessYou 28 дней назад
Thank you so much❤❤❤
@AmanKumarSinhaOfficial
@AmanKumarSinhaOfficial 4 месяца назад
I don't have words to say that you have done for react js community... This video is a masterpiece... Thanks a lot... Please bring some intermediate level projects using React js on this channel. 😊
@CodeBlessYou
@CodeBlessYou 4 месяца назад
Sure I will. You can check also my React JS course - www.udemy.com/course/the-ultimate-react-course-2023-w-real-world-projects/?referralCode=993CD544A6816303D3AD
@mr.mechcoder622
@mr.mechcoder622 4 месяца назад
liking you video with out watching even one hook because your explanation too cooooool🤩
@CodeBlessYou
@CodeBlessYou 4 месяца назад
Thank you so much for your support and trust❤❤❤
@asdfghjkl5418
@asdfghjkl5418 Год назад
Thanks for making it, it's best one I've seen.
@CodeBlessYou
@CodeBlessYou Год назад
My pleasure 😀
@khatariinsaan5284
@khatariinsaan5284 5 месяцев назад
Crystal Clear tutorial, Loved it !
@CodeBlessYou
@CodeBlessYou 5 месяцев назад
Thanks for your support❤❤❤
@mohammadraza8973
@mohammadraza8973 23 дня назад
what a explanation ! your explanation way is too awesome 👏
@CodeBlessYou
@CodeBlessYou 22 дня назад
Thank you so much❤❤❤
@GirishShahapurkar-ko3tf
@GirishShahapurkar-ko3tf Месяц назад
Best tutorial bro and your "take a look" after every statement is pleasant to listen🤣😍😜
@CodeBlessYou
@CodeBlessYou 29 дней назад
😅😅❤❤❤
@lestratege4
@lestratege4 Месяц назад
Best vidéo bro.. Thx a lot.. Nice, simple and good explanation like a kid can Understand... Omg great work
@CodeBlessYou
@CodeBlessYou Месяц назад
Glad to hear that❤❤❤
@ailequal
@ailequal Год назад
Great work, thank you!
@CodeBlessYou
@CodeBlessYou Год назад
My pleasure! Thanks for comment❤
@user-if8nw7bk5m
@user-if8nw7bk5m 4 месяца назад
React Hooks made easy searching lot of videos on youtube this is only one master the React Hooks Thanks❤❤
@CodeBlessYou
@CodeBlessYou 4 месяца назад
Thank you so much. Grateful for your support❤❤❤
@Thisarusaduranga
@Thisarusaduranga Год назад
great tutorial ..👌
@mrfrontend1
@mrfrontend1 Год назад
The best I have seen... Hats 📴 on your effort❤️
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for your support ❤️😇
@skkingcse
@skkingcse 5 месяцев назад
Awesome , 👍 Thank you for clear explanation 😊
@CodeBlessYou
@CodeBlessYou 5 месяцев назад
Grateful for that❤❤❤
@imasunflowerlilfunny3353
@imasunflowerlilfunny3353 10 месяцев назад
bro, i am a beginner and i am amazed ! with tutorial, very easy to understand , thank you!
@CodeBlessYou
@CodeBlessYou 8 месяцев назад
Thank you so much❤❤
@andrews13
@andrews13 Год назад
Subscribed your RU-vid channel . Nice tutorials!
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for your support. Really grateful for that😇❤❤
@friendlyteach1465
@friendlyteach1465 10 месяцев назад
I this you deserved more views and subscribe. Keep it bro I this you will be success one day.❤❤❤
@CodeBlessYou
@CodeBlessYou 10 месяцев назад
You are commenting this, thats success for me ❤❤❤
@keystiva
@keystiva 2 месяца назад
Better way to explanation ❤ great brother
@CodeBlessYou
@CodeBlessYou 2 месяца назад
❤❤❤
@kartik_charvi2412
@kartik_charvi2412 Год назад
Thank you soo much. One of the best bro😊
@CodeBlessYou
@CodeBlessYou 11 месяцев назад
😇😇❤❤
@_rachid
@_rachid Год назад
Thank you that was helpful. If one understand how redux works he can understand useReducer easily.
@CodeBlessYou
@CodeBlessYou Год назад
Agreed! Thanks for this comment😇❤
@honkhonkv2236
@honkhonkv2236 2 месяца назад
Amazing, thank you !
@CodeBlessYou
@CodeBlessYou 2 месяца назад
❤❤❤
@sanojcsam123
@sanojcsam123 Месяц назад
Thank you!
@CodeBlessYou
@CodeBlessYou Месяц назад
❤❤❤
@techieaman96
@techieaman96 Год назад
Thank you, One of the best videos I watched for react hooks. It would have been nice if you have shared all the code examples.
@CodeBlessYou
@CodeBlessYou Год назад
I will share that soon👍
@techieaman96
@techieaman96 Год назад
@@CodeBlessYou thank you
@preethi.k6859
@preethi.k6859 Год назад
Best teaching atlast I learn abt this topics thank you
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for support. Really grateful for that❤️😇
@coderDas
@coderDas 9 месяцев назад
Best and Super Video with all the Examples 🎉🎉🎉❤❤
@CodeBlessYou
@CodeBlessYou 9 месяцев назад
Thank you so much for your feedback❤❤❤❤
@muhammad_ilyas1
@muhammad_ilyas1 Месяц назад
The best React hooks' Video ever.
@CodeBlessYou
@CodeBlessYou Месяц назад
Thank you so much ❤❤❤
@sathishsundar2855
@sathishsundar2855 Год назад
Great work, thanks a lot
@CodeBlessYou
@CodeBlessYou Год назад
❤❤❤
@karthikeyasoft
@karthikeyasoft Год назад
your teaching style is very good and clean .. keep going on....
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for your support😇❤❤
@thuraiit
@thuraiit Год назад
Nice video and neatly explained.
@CodeBlessYou
@CodeBlessYou Год назад
Thanks 😀
@o1techacademy
@o1techacademy Год назад
Thank you very much my teacher. You video is very helpful.
@CodeBlessYou
@CodeBlessYou Год назад
Thank you for this comment❤ Grateful for this comment😇
@parineetadas1366
@parineetadas1366 Год назад
great content🙌
@CodeBlessYou
@CodeBlessYou Год назад
Grateful for your support😇❤
@amargaming5126
@amargaming5126 2 месяца назад
Nice i loved it 😊
@CodeBlessYou
@CodeBlessYou 2 месяца назад
❤❤❤
@pro-code_academy
@pro-code_academy 3 месяца назад
Bhai badhiya explanation tha..God Bless You🫡❤
@CodeBlessYou
@CodeBlessYou 3 месяца назад
❤❤❤
@narendermudgal
@narendermudgal 10 месяцев назад
This is the best tutorials on hook i think, what why where when everything is at place
@CodeBlessYou
@CodeBlessYou 10 месяцев назад
❤❤❤
@valenciawalker6498
@valenciawalker6498 7 месяцев назад
Thank you!!
@CodeBlessYou
@CodeBlessYou 7 месяцев назад
❤❤❤
@sureshdesai4486
@sureshdesai4486 4 месяца назад
Thanks for such a useful content
@CodeBlessYou
@CodeBlessYou 4 месяца назад
❤❤❤
@eMeN903
@eMeN903 Год назад
Thank you for this tutorial
@CodeBlessYou
@CodeBlessYou Год назад
Thanks for your Feedback😀
@niyonkurusylvain7666
@niyonkurusylvain7666 Год назад
Thank you for such a huge work, It is extremely clear explanations !!!!!!
@CodeBlessYou
@CodeBlessYou Год назад
My pleasure, Thanks for your comment😀
@pavansaibitla9008
@pavansaibitla9008 7 месяцев назад
great explaination
@CodeBlessYou
@CodeBlessYou 7 месяцев назад
❤❤❤
@abidmulla2837
@abidmulla2837 5 месяцев назад
hey bro cool what a explainaion
@CodeBlessYou
@CodeBlessYou 5 месяцев назад
Glad to hear that❤❤❤
@dabhibrijesh6835
@dabhibrijesh6835 Месяц назад
content quality is very good.
@CodeBlessYou
@CodeBlessYou Месяц назад
❤❤❤
@manjunathr6902
@manjunathr6902 8 месяцев назад
Thank you
@CodeBlessYou
@CodeBlessYou 8 месяцев назад
❤❤
@shayanfaisal19009
@shayanfaisal19009 7 месяцев назад
nice video very infomative
@CodeBlessYou
@CodeBlessYou 6 месяцев назад
Glad you liked it😊
@simmi641
@simmi641 23 дня назад
Wonderful explanation
@CodeBlessYou
@CodeBlessYou 23 дня назад
❤❤❤
@N_n5566
@N_n5566 3 месяца назад
very usefull.nice explanation
@CodeBlessYou
@CodeBlessYou 3 месяца назад
❤❤
@vaibhavagarwal1479
@vaibhavagarwal1479 26 дней назад
Life saver
@CodeBlessYou
@CodeBlessYou 25 дней назад
❤❤❤
@pupil_1
@pupil_1 Год назад
Underrated video
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for your support😇❤❤
@blackwyverngaming386
@blackwyverngaming386 29 дней назад
Please make video on advance js😊
@thulasiraman2296
@thulasiraman2296 Год назад
It Hooks Concept is very easy understand for your video watching so please continue with other new concepts except the Life cycle method and Redux concepts make video please, and Thank for this video😍
@CodeBlessYou
@CodeBlessYou Год назад
I have complete course on Redux you can check this out - www.udemy.com/course/the-ultimate-redux-course-state-management-library/?referralCode=0E6517D629498E1C48D7 Also one hour trail course is on RU-vid about redux ❤
@92_satyamyadav48
@92_satyamyadav48 6 месяцев назад
Bro ur underrated, dont worry keep it up what's your name bro, Thank you for video, If you know, make nextjs video, i dont know if it has
@CodeBlessYou
@CodeBlessYou 6 месяцев назад
My name is Meet Patel. Thank you so much for this comment❤❤❤
@priyanshunishad7402
@priyanshunishad7402 Год назад
you are underated man
@CodeBlessYou
@CodeBlessYou Год назад
I will get what I deserve. Don't worry chill❤❤❤😉😉
@shahhussain56
@shahhussain56 Год назад
its extremely simple and crisp explanation bro. Thanks a million❤ I just need all the notes which you used in the video. Would you provide us?
@CodeBlessYou
@CodeBlessYou Год назад
Actually, I am currently working on Complete Redux Course. That's why it will take some time. But I will provide as soon as possible. Sorry For Delay❤❤
@surajchaudhary1162
@surajchaudhary1162 Год назад
@@CodeBlessYou eagerly waiting for the redux course. 🤗
@CodeBlessYou
@CodeBlessYou Год назад
It's already launched.. Hurry up Get this course *100% FREE* from here - www.udemy.com/course/the-ultimate-redux-course-state-management-library/?couponCode=07423F2A93D56EE560CE
@kuldeepsingh-eg8hw
@kuldeepsingh-eg8hw 22 дня назад
very good explanation
@CodeBlessYou
@CodeBlessYou 21 день назад
❤❤❤
@tapuparida7802
@tapuparida7802 6 месяцев назад
Great
@CodeBlessYou
@CodeBlessYou 6 месяцев назад
Thanks for watching❤
@NEOCODE-ATLAST
@NEOCODE-ATLAST 7 месяцев назад
00:00 🎓 React Hooks are functions that enable the use of state and lifecycle methods in functional components, making them work similarly to class components. 02:03 🪝 useState hook is used to add state to functional components. It returns an array with the current state value and a function to update that value. 03:25 🔄 Updating state with useState involves calling the function returned by the hook and passing the new value. Array destructuring can be used to simplify the code. 04:51 📥 useState can handle different types of data (boolean, number, text, object, array). It's demonstrated with examples of a counter and a text input. 06:03 🔄 When dealing with an object as state in useState, ensure to update the state properly to avoid losing other elements. Use the spread operator to include previous values. 08:58 🎭 useEffect is used for side effects in components, such as fetching data, manipulating the DOM, or using timers. It combines componentDidMount, componentDidUpdate, and componentWillUnmount. 11:27 📋 useEffect has three variations: without dependencies (runs on every change), with an empty array (runs once on mount), and with variables (runs on mount and when specified variables change). 15:22 🧹 Cleanup functions in useEffect are essential to handle scenarios where side effects need to be stopped or cleaned up, preventing performance issues. 18:34 🌐 useContext is used to manage global data in React, allowing components to access shared values without passing them through props. 23:10 📦 To use useContext, follow three steps: create the context, provide the context in the component hierarchy, and consume the context using the useContext hook. 25:42 🔍 useRef serves two main purposes: creating mutable variables without causing re-renders and accessing DOM elements directly. 28:17 🔄 Using useRef to count renders without causing re-renders, avoiding the infinite loop issue that might occur with useState. 28:56 🔄 Use useRef to access and manipulate DOM elements without re-rendering. The current property is used to interact with the element. 32:24 🔄 useReducer is a state management tool in React for managing complex states. It takes a reducer function and an initial state, returning an array with the current state and a dispatch function. 40:14 🌐 useLayoutEffect is similar to useEffect but runs before the DOM is painted. It's synchronous and commonly used for measuring and working with layout dimensions. 45:14 ⚡ useMemo is used for memoization in React, preventing expensive calculations on every render. It takes a callback function and a dependency array, returning a memoized value. 49:59 🤔 useCallback returns a memoized function, preventing function recreation on re-render. It has the same syntax as useMemo, with the difference that it returns a function. 55:22 🛠 Custom hooks are reusable functions in React, created for specific logic or use cases. They enhance code organization and maintainability, promoting the DRY (Don't Repeat Yourself) principle.
@CodeBlessYou
@CodeBlessYou 7 месяцев назад
Incredible Work! Love it ❤❤❤
@abrahamjaimes7643
@abrahamjaimes7643 Год назад
27:00 teacher when you use useEffect , you could set up dependencies [name] and the hook will re render only when name gets updated.
@CodeBlessYou
@CodeBlessYou Год назад
The goal of that example is to demonstrait infinite rerenders.
@abrahamjaimes7643
@abrahamjaimes7643 Год назад
@@CodeBlessYou got it , teacher when are you going to complete all the hooks in videos ?
@CodeBlessYou
@CodeBlessYou Год назад
@@abrahamjaimes7643 Currently I am working on React Course and it is taking more time than i imagine. In that course I will add useful hooks❤❤
@brahmendranchary5852
@brahmendranchary5852 Год назад
very nice explanation
@CodeBlessYou
@CodeBlessYou Год назад
Thank you so much for support❤❤
@mrfabulous3303
@mrfabulous3303 Год назад
Thanks
@CodeBlessYou
@CodeBlessYou 8 месяцев назад
❤❤
@wreshinlinux6091
@wreshinlinux6091 6 месяцев назад
one thing that i have notice is the reducer can put in folder called Reducer to make looks more organize, am i right? , . . im currently studying react hooks and your explanation makes me confident to use react hooks.
@CodeBlessYou
@CodeBlessYou 6 месяцев назад
Absolutely Correct. You can organize reducer by seperating reducer function from component code. Glad for your comment :)
@AjayYadav-vb7vd
@AjayYadav-vb7vd 6 месяцев назад
14:39 issue in explanation useEffect document.title is taken only othercount then how can it take count while clicking increase count their is no need of dependency dependency is to be given if we take document.title = `count: ${count} & newCount: ${newCount}` if we want to change only on change of count then we need to give count as dependency
@gzoechi
@gzoechi Год назад
With useLadoutEffect, how can it read layout (getComputedStyle(), ...) from DOM before the DOM updates are rendered. This doesn't add up for me.
@user-yk3yt4vk9j
@user-yk3yt4vk9j 5 месяцев назад
subscribed for the amazing content😍
@CodeBlessYou
@CodeBlessYou 5 месяцев назад
Thank you so much. If you like this then You can Check my complete React JS course 2024 : www.udemy.com/course/the-ultimate-react-course-2023-w-real-world-projects/?referralCode=993CD544A6816303D3AD
@user-yk3yt4vk9j
@user-yk3yt4vk9j 5 месяцев назад
@@CodeBlessYou oh boy it's quite expensive for me as living in Pak. But you have my all support on youtube. 🌺🌺
@CodeBlessYou
@CodeBlessYou 5 месяцев назад
Thank you so much for your support brother@@user-yk3yt4vk9j ❤❤❤
@user-yk3yt4vk9j
@user-yk3yt4vk9j 5 месяцев назад
@@CodeBlessYou when I watch your videos I don't skip adds. That's the only way I could support you now. But in future if someone ask me about sources from where I have learnt then I would definitely recommend him your channel.
@CodeBlessYou
@CodeBlessYou 5 месяцев назад
@@user-yk3yt4vk9j It means a lot to me. I just want love, money will come if I am capable. Love you brother❤❤
@kanishkasandaruwan9287
@kanishkasandaruwan9287 Месяц назад
27:07 is wrong...The state changes continuously due to not having the dependency array of UseEffect. It is not a problem of UseState.
@CodeBlessYou
@CodeBlessYou Месяц назад
I will check that
@sandeepkumar-nk9vk
@sandeepkumar-nk9vk 8 месяцев назад
hi , i have a doubt on useLayoutEffect, before Dom printing how to take the ref element from the dom. Please explain that flow.
@CodeBlessYou
@CodeBlessYou 8 месяцев назад
To obtain a reference to a DOM element before it gets printed or rendered, you can use the useLayoutEffect hook in a React component. Here's a step-by-step explanation of how to achieve this: Create a Functional Component: Create a functional component in which you want to obtain a reference to a DOM element. function MyComponent() { // Create a ref to store the DOM element reference const myElementRef = useRef(); // Define a function to capture the reference to the DOM element useLayoutEffect(() => { const element = myElementRef.current; if (element) { // Now, you can work with 'element' console.log('Reference to the DOM element:', element); // Perform any actions you need with the element here } }, []); return ( {/* Attach the ref to the DOM element you want to capture */} This is the DOM element. ); } Use useLayoutEffect: Inside the component, use the useLayoutEffect hook to capture the reference to the DOM element. The useLayoutEffect hook runs after the browser layout and before the paint, making it suitable for working with DOM elements. Attach the Ref to the DOM Element: Within your component's JSX, attach the ref to the specific DOM element you want to capture. In this example, we attached the myElementRef to a div element, but you can attach it to any DOM element as needed. Access and Use the DOM Element: Inside the useLayoutEffect, you can access the DOM element using the current property of the ref. Once you have the reference, you can perform any actions or operations you need with the element. In the example, we log the reference, but you can modify it according to your requirements. By following this approach, you can capture a reference to a DOM element and perform actions on it before it gets printed or rendered. This is particularly useful for tasks like obtaining the dimensions of an element, setting up event listeners, or manipulating the DOM before rendering.
@CinematicClips-uz3mk
@CinematicClips-uz3mk 2 месяца назад
It looks like a 1 hour video but I bet you it will take up to 4 hours if you run all codes and take notes
@CodeBlessYou
@CodeBlessYou 2 месяца назад
Yeah It can❤❤❤
@vaibhavk191
@vaibhavk191 11 дней назад
INSTEAD OF USING THE USECONTEXT WE CAN USE STATE AND PROPS?
@CodeBlessYou
@CodeBlessYou 10 дней назад
Yes we can. But when you have so much props drilling then use useContext
@stephengrantsumadsad86
@stephengrantsumadsad86 3 месяца назад
enteeeeeeeeeeeeeeeeeeekaaaaluuuk!
@manisaikumar3466
@manisaikumar3466 28 дней назад
Hii CodeBlessYou , i have a dought that in useState while passing a object when i enter the name and increseing the count then is it showing NAN times can i know why and name is not printing...hope i get a answer for that
@CodeBlessYou
@CodeBlessYou 27 дней назад
When you update your value, you have to fill that object first with the previous values and then update name property of the state object. If you still confused, you can simply console both state and your name property to see what is happening.
@sacettinsahin7791
@sacettinsahin7791 Год назад
Hello, thanks to this video. Actually you use amazing VS Code templete. Could you share your templete's name?
@CodeBlessYou
@CodeBlessYou Год назад
I use AYU theme in VS code. These are my 5 BEST VS Code theme - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-EGaC23tmjhc.html
@sacettinsahin7791
@sacettinsahin7791 Год назад
@@CodeBlessYou Thank you to response, i subscribed and liked :)
@CodeBlessYou
@CodeBlessYou Год назад
@@sacettinsahin7791 Thank you so much for your support. Really grateful for that😇❤
@sai7743
@sai7743 Год назад
Can you explain login authentication of jwt in reactjs
@CodeBlessYou
@CodeBlessYou Год назад
Why not😀
@nishanths3176
@nishanths3176 3 месяца назад
Can i get the source code for each hooks
@CodeBlessYou
@CodeBlessYou 3 месяца назад
Sorry I forgot to take backup for each hook. Really really sorry
@shrikush01
@shrikush01 7 месяцев назад
Take aa looook
@CodeBlessYou
@CodeBlessYou 7 месяцев назад
😅😅😉
@abdulsamad74581
@abdulsamad74581 Год назад
This is brilliant explanation. But you are too fast before I can wrap my head around a concept u have already explained 3 more. Pls slow down, reduce Ur speed by half thank you.
@CodeBlessYou
@CodeBlessYou Год назад
Ok I will work on that. Thank for your feedback brother😇❤
@saikrishnamuntha62
@saikrishnamuntha62 2 года назад
where is the cheatsheet of useeffect
@CodeBlessYou
@CodeBlessYou Год назад
Sorry I forget To mention.. Check in Description
@shinchanshukla3938
@shinchanshukla3938 Год назад
Saikrishna, Say thanks to CBY.
@vonnachoy306
@vonnachoy306 4 месяца назад
TOGEL
@andrews13
@andrews13 Год назад
Could you please share the source code too?
@CodeBlessYou
@CodeBlessYou Год назад
I will try to create one Github Repo but first I need to find this code🙂 (Sorry for that)
@andrews13
@andrews13 Год назад
@@CodeBlessYou Thanks! Waiting for it :)
@vonnachoy306
@vonnachoy306 4 месяца назад
AND TAKE A LOOK!!!!!!
@CodeBlessYou
@CodeBlessYou 4 месяца назад
😅😅❤❤
@b_64anantsadawarte76
@b_64anantsadawarte76 4 месяца назад
The best React hooks' course ever. Thanks a lot.
@CodeBlessYou
@CodeBlessYou 4 месяца назад
Thank you so much for this comment. Really grateful for that❤❤❤
Далее
Why React Dominate Other Frameworks? HERE WHY
6:37
Просмотров 1,3 тыс.
React Hooks Course - All React Hooks Explained
1:26:21
The last one surprised me! 👀 🎈
00:30
Просмотров 3 млн
He turned a baseball into a stylish shoe😱
00:59
Просмотров 788 тыс.
Multiple List Drag and Drop in React [Easiest Way]
22:03
Learn React Hooks: useRef - Simply Explained!
12:42
Просмотров 81 тыс.
Learn useState In 15 Minutes - React Hooks Explained
15:45
React State Management - Intermediate JavaScript Course
2:46:38
Every React Concept Explained in 12 Minutes
11:53
Просмотров 426 тыс.
ALL React Hooks Explained in 12 Minutes
12:21
Просмотров 89 тыс.