Open
Description
import axios from "axios";
export const apiClient = axios.create({
baseURL: "myBaseUrl"
});
const getData = async (id: string) => {
console.log(' I am not getting called WHY')
const response = await apiClient.get<any>(`api/${id}`);
return response.data;
};
const useGetData = (id: string) => {
// console is also coming till here
return useQuery(['myApiEndPoint', id], () => getData(id));
};
// inside component
const response = useGetData(id);
console.log({response})
Metadata
Metadata
Assignees
Labels
No labels