useEffect and useLayoutEffect | React Hooks | React.js Tutorial #6

Опубликовано: 26 Октябрь 2020
на канале: Bruno Antunes
8,621
424

In this video we'll learn you how and when to use useEffect and/or useLayoutEffect in React.
We will also learn about side-effects.

We will compare useEffect and useLayoutEffect using a timeline diagram to understand when both run.

----
React.js Tutorial Playlist:    • React.js Tutorial with Hooks and Type...  
----

----
SWR Video:    • React Hooks SWR: Fetch, Cache and ReV...  
----

----
GitHub Repository: https://github.com/bmvantunes/youtube...
GitHub Commit history: https://github.com/bmvantunes/youtube...
----

Relevant Links for this video:
----
json2ts: http://json2ts.com/
SWR Documentation: https://swr.vercel.app/
React.js useEffect Documentation: https://reactjs.org/docs/hooks-effect...
React.js Hooks Reference Docs: https://reactjs.org/docs/hooks-refere...
----

Timeline:
00:00 Introduction
00:23 What is a side effect?
02:23 Example from React Documentation
02:45 What are our intentions when coding?
03:25 useEffect and useLayoutEffect timeline
08:00 Code example using setTimeout
16:14 Example with HTTP calls (using fetch)
20:20 Homework description
21:20 SWR Recomendation
21:40 Conclusion


#ReactJS #Hooks #ReactHooks #useEffect
----
Follow me on:
Twitter:   / bmvantunes  
Dev.to: https://dev.to/bmvantunes
Website: https://brunoantunes.net
Github: https://github.com/bmvantunes
LinkedIn:   / bmvantunes  


Смотрите видео useEffect and useLayoutEffect | React Hooks | React.js Tutorial #6 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Bruno Antunes 26 Октябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 8,621 раз и оно понравилось 424 людям.