You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, every time we want to get the user, or fetch all projects, or anything else, we create a whole react query call inside the component, defining a query key and api route that we call.
We should abstract this away into our own custom hooks that call react query queries. This way, this
Currently, every time we want to get the user, or fetch all projects, or anything else, we create a whole react query call inside the component, defining a query key and api route that we call.
We should abstract this away into our own custom hooks that call react query queries. This way, this
const { data, isLoading, isError } = useQuery({ queryKey: ["allProjects"], queryFn: async () => { const response = await axios.get("/api/projects"); return response.data; }, });
can just be a single line in any given file.
The text was updated successfully, but these errors were encountered: