Fetch-In-React Flashcards

1
Q

How can useEffect be used to load data for a component?

A
  1. update our useEffect to pass a prop called id to the URL,
  2. use a dependency array, so that we only run this useEffect when id changes, and then.
  3. use the useState hook to store our data so we can display it later.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly