반응형 react-query warning : query data cannot be undefined. please make sure to return a value other than undefined from your query function.1 react-query warning : query data cannot be undefined. please make sure to return a value other than undefined from your query function. query data cannot be undefined. please make sure to return a value other than undefined from your query function. 처음에는 쿼리키 문제인줄 알았다. 하지만 쿼리키를 아무리 조작해봐도 해결되지 않아 구글링을 해보니 Promise를 반환하는 react-query의 query가 undefined를 반환하거나 아무것도 반환하지 않을때 나타난다. 비동기 함수가 아닌 동기 함수를 쿼리 함수로 사용헀거나, 비동기 함수에서 await 키워드를 잘못 사용했을 수 있다. query data cannot be undefined 에러 해결 과정 타입을 Promise로 선언해주고 해결되기를 기대했지만 해결되지 않았다. 나는 openAPI를.. 2022. 11. 19. 이전 1 다음 반응형