Тёмный

React Hooks Best Practices 

PedroTech
Подписаться 208 тыс.
Просмотров 17 тыс.
50% 1

In this video I go over some best practices when using hooks in react.
The first 1,000 people to use the link will get a 1 month free trial of Skillshare: skl.sh/pedrotech11221
Join our Discord: / discord
🚀 Learn ReactJS By Building 6 Projects: codedamn.com/learn/reactjs-pr...
🐙 GraphQL Course: codedamn.com/learn/graphql-fo...
► Buy Crypto on Coinbase: coinbase-consumer.sjv.io/PedroTech
Social
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
Website: machadopedro.com
Linkedin: / machadop1407
Instagram: / _pedro.machado_
Github: github.com/pedro.fmachado_
Business Email: pedro@pedrotech.co
Tags:
- ReactJS Tutorial
- ReactJS and MySQL
- NodeJS Tutorial
- API Tutorial
#reactjs #coding

Наука

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

 

12 дек 2022

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 51   
@eshw23
@eshw23 Год назад
Authentication with Express/Node would be a great tutorial, love your videos as always
@nikakondra5321
@nikakondra5321 Год назад
Would be great
@davidhavl
@davidhavl Год назад
Great tips, thank you Pedro. Coming from decades of backend development, comparison I would use to resonate with old devs (like me) is: custom hooks (especially residing in same folder/subfolder) are basically functional way of achieving what "services" achieve in OOP coding (symfony, angular, nestjs,...). Both were created for similar reasons like separation of concerns and testability.
@shadialmohtaseb6419
@shadialmohtaseb6419 Год назад
That awesome, I'm always questions if it's good to make a custom hook for every logic in my application. Thanks pro ❤️❤️🔥
@PedroNovo93
@PedroNovo93 Год назад
Hey Pedro, Do you have any repo where you implement this custom hooks logic?
@rhiannonmonks6894
@rhiannonmonks6894 Год назад
Nice short video with great tips. I would love for you to do a short video of an example project and test showing how you separate out your custom hooks from components and also how you write a test for these, as a an example
@VictorDequidt
@VictorDequidt Год назад
Definetly agree, quick question : where do you put your custom hooks to keep project folder structure clean and organized ?
@me-cz3wo
@me-cz3wo Год назад
If you wan I can give you an quick answer, All my useEffect hooks are always in a separate file (MyComponent/hooks.ts), I always respect the S solid principle (single responsibility principle) it means if my hooks make thing differents I always split it into separate hooks. When my hook is complicated I add an comment explaining the purpose of the hook All my global hooks (for example useOnClickOutside) are a hook's directory at the project's top level src - hooks - utils - components - MyComponent - page - MyPage
@mohammadmahdialvansaz8001
@mohammadmahdialvansaz8001 Год назад
Thank you
@alinaser2332
@alinaser2332 Год назад
The best teacher ever ❤
@manhlinhnguyen.51
@manhlinhnguyen.51 Год назад
Thank you 😍😍😍
@dragosp.7635
@dragosp.7635 Год назад
Hi Pedro, can you recommend a channel for Angular please?
@JoonasKarp
@JoonasKarp Год назад
One question: could you make video on difference between isomorphic-fetch and normal fetch in react?
@harshpatani1923
@harshpatani1923 Год назад
Hey Pedro, my current tech stack is HTML, css, JavaScript, reactjs, redux , bootstrap, MUI. My question is what should I learn next and from where?. I wanted to be Full stack mern developer and wanted to learn node.js and express.js and mongoDB , can you suggest from where should I learn because I am pretty confused about it.
@wastedmama
@wastedmama 9 месяцев назад
Which camera u r using brother
@Hero786-
@Hero786- Год назад
I just subscribed you for react and love your videos sir, Thanks for everything
@brpp19
@brpp19 Год назад
Hey Pedro, I wonder if you could shoot a video about deploying a ReactJs + NodeJS + Express + MySQL on Railway, that would be much appreciated! Unfortunately Heroku did away with the free tier and now I am struggling to find out how to deploy a fullstack project and I learned that Railway would be a good solution for that. Obrigado and happy holidays!
@wadf29
@wadf29 Год назад
Great thanks
@fcrrjbr
@fcrrjbr Год назад
Mano seu canal eh top, mas conta ai como aprendeu o ingles e chegou no dominio? Parabens
@ahmedjaber8595
@ahmedjaber8595 Год назад
When the nextjs 13 course for beginners launch ? i want to learn it from experienced dev like you Thanks
@nabinsaud4688
@nabinsaud4688 Год назад
Great bro
@ansishfaq727
@ansishfaq727 Год назад
Brother firstly you are doing such a great job...❤️❤️❤️ Your tutorials are much easy and understandable,,, really appreciated Secondly I Wana ask that I have learnt J's at intermediate level and almost cover Es6 modern things, I Wana ask should I need to first become expert in J's and cover all stuff and then shift to react or i should shift to react now ,, Please guide
@juliaxyz
@juliaxyz Год назад
I'd like to see a tutorial on implementing express-sessions with redux-toolkit and rtk-query. I haven't been able to find a single one. Thanks for your videos!
@nogombrate
@nogombrate Год назад
I look at custom hooks same as components if for example i think functiinaly will be used manny times i will make custom hook same wih reusable component and if something is uniqe and i will not use it anywhere else i will leave funcrionaly inside that specific component.
@TheSharkbeast
@TheSharkbeast Год назад
Hey i tried the Instagram link , it dsnt seem to work, please check that!
@jatilyadav4000
@jatilyadav4000 Год назад
Always the best
@leoMC4384
@leoMC4384 Год назад
Great content as always. However it would've been better if you show the examples with code. About useCallback I use to put that everywhere in my project but not anymore. Recently I created a component with its hook inside another component with its own hook which receive data from the callback function from the inner component. If I don't use useCallback in the inner component, I get an infinite loop of re-rendering. React itself told me to use it in the console. 👌
@cboniefbr
@cboniefbr Год назад
Pedro, tu é foda!
@oncoding4520
@oncoding4520 Год назад
You are great. Where is going to be another project ? :))
@sh44ko58
@sh44ko58 Год назад
Hey, can u make a new utorial with React,Node,mysql and cookies ? Ur last tutorial was good, but it was confusing.. U created back then cookies but u used sessions to get the user data, and they expire every 2 minutes..
@monarchgam3r
@monarchgam3r Год назад
PS, hooks can be called in functional components, or inside other custom hooks
@saurabhkr1139
@saurabhkr1139 Год назад
Can you please make a video on redux .
@ShavezAli-pl3pw
@ShavezAli-pl3pw Год назад
Why there is no code example 🤔
@Salah-YT
@Salah-YT Год назад
thx bro but I think it better u show us some example code not just talking bro because I'm a beginner and many people are beginners so thanks anyway and keep it up bro
@romeorichardson3138
@romeorichardson3138 Год назад
Black Nail polish or riot 😤
@PedroTechnologies
@PedroTechnologies Год назад
It comes in cycles hahaha maybe next month I will do it again!
@oleksandrluchytskyi6867
@oleksandrluchytskyi6867 Год назад
useCallback() not needed for passing as a component’s props, really? Can you show an example?
@ericmomoh7927
@ericmomoh7927 Год назад
It is use to prevent a child component to rerender when it props have not changed even if the parents component rerender
@oleksandrluchytskyi6867
@oleksandrluchytskyi6867 Год назад
@@ericmomoh7927 example when no needed as a props?
@ericmomoh7927
@ericmomoh7927 Год назад
To make it clear is this; when a component render it functions get recreated and when that function is passed as a props to a child component, that child component will rerender because that functions that get recreated due to the parent render, the function has actually changed and it will cause the child component receiving it as props to rerender. To prevent this rerender behavior we wrap the function in useCallBack hook to prevent this behavior
@chesterxp508
@chesterxp508 Год назад
GoodJob! If you talk about some case is better if you show example at code.
@ImamNurArifinHA
@ImamNurArifinHA Год назад
It would be better if given a coding example
@PedroTechnologies
@PedroTechnologies Год назад
I agree! I should've put an infographic for the useCallback example, sorry about that hahaha I will do it next time :)
@raki0125
@raki0125 Год назад
I hope he will do next year hooks best practices in 2024 🙃
@renoydsouza4677
@renoydsouza4677 Год назад
Would never not pay attention in class if my teacher was this sexy looking, ngl🙋😂❤️
@PedroTechnologies
@PedroTechnologies Год назад
Lmaoo thank you
@abdiazismaxamed7665
@abdiazismaxamed7665 Год назад
Lesson chatgpt About
@PedroTechnologies
@PedroTechnologies Год назад
ChatGPT video is coming soon!
@AlexJohnSuarez
@AlexJohnSuarez Год назад
It is hard to imagine what you are saying when there is no illustration, pure talking.
Далее
How To Increase Performance in React Apps
14:19
Просмотров 25 тыс.
Why Signals Are Better Than React Hooks
16:30
Просмотров 464 тыс.
СОБАКИ ГОЛОДАЮТ ИЗ-ЗА ЛЕРЫ 🥲
01:00
Камень, ножницы, нейронка
00:33
Просмотров 909 тыс.
UseEffect Mistakes Every Beginner Should Avoid
18:05
Просмотров 28 тыс.
4 React Best Practices That Will Make You A PRO
18:12
Просмотров 145 тыс.
Why React Hooks?
14:04
Просмотров 173 тыс.
Enums considered harmful
9:23
Просмотров 199 тыс.
Stop Doing this as a React Developer
12:27
Просмотров 161 тыс.
Every React Concept Explained in 12 Minutes
11:53
Просмотров 489 тыс.
10 React Antipatterns to Avoid - Code This, Not That!
8:55
Top 6 React Hook Mistakes Beginners Make
21:18
Просмотров 564 тыс.