Fetch-In-React Flashcards

1
Q

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

A

you can use useEffect so that after a component renders, you can fetch data from an api

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

You can tell React to skip unnecessarily re-running the Effect by specifying an array of dependencies as the second argument to the useEffect call

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

by not specifying dependencies

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

using third party data management library such as react query and Vercel SWR

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