React hooks #6 React Course | Code with Sloba

Опубликовано: 04 Февраль 2022
на канале: Code with Sloba
2,125
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 Cour...  
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_  


Смотрите видео React hooks #6 React Course | Code with Sloba онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Code with Sloba 04 Февраль 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 2,12 раз и оно понравилось 4 людям.