Learn React #9: UseEffect & UseEffect with API Requests

Anthony Sistilli
Anthony Sistilli
45.6 هزار بار بازدید - 4 سال پیش - In this video we go
In this video we go over how to use React's useEffect hook complete with translations to componentDidMount, componentDidUpdate, and componentWillUnmount as well as fetch requests for api and data with Axios.
- 0:00 Introduction
- 0:55 The component lifecycle overview
- 3:00 UseEffect Basics
- 3:50 The array in the useEffect
- 4:00 Mount useEffect (componentDidMount)
- 4:20 Update useEffect (componentDidUpdate)
- 7:00 Unmount / Cleanup useEffect (componentWillUnmount)
- 8:55 No array useEffect
- 9:55 Combining update useEffect with cleanup
- 12:40 API Requests with useEffect

CodeSandbox.io link:
https://codesandbox.io/s/ecstatic-sha...

Fake JSON data:
https://jsonplaceholder.typicode.com/
https://jsonplaceholder.typicode.com/...

Axios Example:
https://www.digitalocean.com/communit...

React useEffect Hook Docs:
https://reactjs.org/docs/hooks-effect...

The Forge Coding Tutorials...http://theforge.ca

Follow me on Social Media:
LinkedIn: asistilli
TikTok: anthonysistilli
Instagram: asistilli
4 سال پیش در تاریخ 1399/07/26 منتشر شده است.
45,610 بـار بازدید شده
... بیشتر