Fetch-In-React Flashcards
How can useEffect be used to load data for a component?
you can use useEffect so that after a component renders, you can fetch data from an api
What browser function can be used to make HTTP requests to a server in React?
How do you use useEffect to load component data just once when the component mounts?
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 do you use useEffect to load component data every time the data key changes?
by not specifying dependencies
In a large-scale production app, what are some better alternatives for loading and managing backend data?
using third party data management library such as react query and Vercel SWR