fetch-in-react Flashcards

1
Q

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

A

you can fetch data and set states or update props

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What browser function can be used to make HTTP requests to a server in React?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you use useEffect to load component data just once when the component mounts?

A

leave the dependency as an empty array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you use useEffect to load component data every time the data key changes?

A

add that as a dependency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly