fetch Flashcards
What does fetch( ) return?
returns a promise and
What is the default request method used by fetch( )?
‘get’ request method
How do you specify the request method (GET, POST, etc.) when calling ‘fetch’?
you pass a second parameter the options method
How does ‘fetch’ report errors?
How can useEffect be used to load data for a component?
yes by using a fetch
What browser function can be used to make HTTP requests to a server in React?
fetch
How do you use useEffect to load component data just once when the component mounts?
you pass in an empty array for the dependencies
How do you use useEffect to load component data every time the data key changes?
you pass it into the dependencies array
In a large-scale production app, what are some better alternatives for loading and managing backend data?