I trying react-query for data-fetching (in Typescipt)
in my books, maybe I guess use react-query V3. but I want to react-query v4
in my books, using react-query...
const useLatestMovie = () => {
return useQuery<AxiosResponse<MovieDetail>, AxiosError>('latestMovie', latestApi)
}
and call function other files,
const { isLoading, data } = useLatestMovie()
but this code isLiading, data not exist because "Property 'data' does not exist on type 'Promise'."
how do I make this code can work?