웹 개발/React
useQuery - Missing queryFn error
헤일리_HJ
2022. 3. 11. 15:35
https://stackoverflow.com/questions/70319827/missing-queryfn-error-when-using-usequery
Missing queryFn error when using useQuery
As the title suggests, I am new to using useQuery and the associated libraries, I am trying to use it to fetch data and then populates a list of fields that I have created However when I run it I get
stackoverflow.com
export const videoInfo = (onSuccess, onError, id) => {
return useQuery(['get-videoinfo', id], () => videoInfoAPI(id), {
onSuccess,
onError,
});
};
이런식으로 써줘야 한다.