Quote
Even if it’s only for wrapping one useQuery call, creating a custom hook usually pays off because:
You can keep the actual data fetching out of the ui, but co-located with your useQuery call.
You can keep all usages of one query key (and potentially type definitions) in one file.
If you need to tweak some settings or add some data transformation, you can do that in one place.
쿼리 관리
커스텀 훅을 만들어 관리하는 게 좋다. 이렇게 하면 쿼리 키나 타입 정의를 재사용할 수 있고 데이터 전처리도 한 곳에서 할 수 있기 때문이다.