79361280

Date: 2025-01-16 10:59:01
Score: 2
Natty:
Report link

This is not an answer but more of a question. I have a strange case here:

const useTodos = () => useQuery('todos', fetchFunction)
//this hook basically takes the API data and do some other business with local data
const useApiAndLocalTodos () => useTodos()

Then in my components

HomeComponent:

const { data } = useApiAndLocalTodos()

TodosComponent:

const { data } = useApiAndLocalTodos()

Now I see two different network calls even if it's the same query. Any idea why?

Reasons:
  • Blacklisted phrase (1): not an answer
  • Blacklisted phrase (0.5): why?
  • Has code block (-0.5):
  • Ends in question mark (2):
  • High reputation (-1):
Posted by: Blessing