dukDukz

useQuery - Missing queryFn error 본문

웹 개발/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,
  });
};

이런식으로 써줘야 한다.

'웹 개발 > React' 카테고리의 다른 글

react drag and drop  (0) 2022.03.16
useHistory 오류 발생  (0) 2022.03.16
React classNames  (0) 2022.02.14
React-Query 비동기 통신 (기본편)  (0) 2022.02.11
[Error] Manifest: Line: 1, column: 1, Syntax error.  (0) 2022.02.11