React hooks #6 React Course | Code with Sloba

Publié le: 04 février 2022
sur la chaîne: Code with Sloba
2,195
48

React hooks #6 React Course | Code with Sloba

React hooks are a way for your function components to “hook” into React’s lifecycle and state.

React hooks were introduced in Reactjs 16.8.

But you must be thinking why the heck do I need hooks when I can do everything in the class component as well?

The core of Reactjs is the ability to break down complexity into smaller pieces.

However, we often can’t break complex components down any further because the logic is stateful and can’t be extracted to a function or another component.

This is solved with hooks and hooks let you always use functions instead of having to constantly switch between functions, classes, higher-order components, and render props.

Apart from that, react hooks cut your code like diet cuts fat, make your code slimmer, more concise, and more readable.

So hooks in React are recommended over class components, but that doesn’t mean that you should rewrite your old class components. So don’t sweat.

0:00 Intro
0:10 Why should we use hooks?
0:55 Types of hooks in Reactjs?
1:07 useState hook
2:27 useEffect hook
4:20 rules of hooks

************************************************************
Previous Video:    • Managing state in React #5 React Course | ...  
Next video:    • Handling Events In React #7 React Course  
Full series:    • Full React Course  
************************************************************

🧿 I discussed:

✔️ What are Reactjs hooks?
✔️ Why do we use hooks in Reactjs?
✔️ What is the preferred way of components in React?
✔️ How to use useState hook in Reactjs?
✔️ How to use useEffect hook in Reactjs?


Social Media
**********************************

👉 Linkedin:
✔️   / slobodan-gajic  

👉 Portfolio:
✔️https://bobangajicsm.github.io/portfo...

👉 Twitter:
✔️  / _slobodangajic_  


Sur cette page du site, vous pouvez voir la vidéo en ligne React hooks #6 React Course | Code with Sloba durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Code with Sloba 04 février 2022, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 2,195 fois et il a aimé 48 téléspectateurs. Bon visionnage!