Fetch in React Flashcards

1
Q

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

A

After the page has been rendered you can add data after the fact

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

fetch

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

put an empty dependency

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

[the data key]

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

In a large-scale production app, what are some better alternatives for loading and managing backend data?

A

React Query, Vercel SWR

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