useQuery with different queryKey
so basically guys im trying to fetch an api using react query and i find my self doing some reptitive code durning the fetch so i decide to make this :
and inside my component like this :
so is there any error in my code or some future probleme that i will face
2 Replies
optimistic-gold•2y ago
It works but your query key is not legible
Do queryFn: ()=>fetchData(series_id) instead
environmental-roseOP•2y ago
yeah ok