Skip to content
Discussion options

You must be logged in to vote

in v3, the query key is no longer spread into the queryFn. please see the upgrade guide: https://react-query.tanstack.com/guides/migrating-to-react-query-3

const fetchStudentDetail = async (id) => {
  const response = await httpClient.get(`/students/${id}/details`);
  return response.data;
};

const {status, data, error, isError, isLoading, isFetching} = useQuery(
    ['student-detail', studentId],
    () => fetchStudentDetail(studentId));

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@Xi-gofore
Comment options

@TkDodo
Comment options

@Xi-gofore
Comment options

@Xi-gofore
Comment options

@TkDodo
Comment options

Answer selected by Xi-gofore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants