How to refetch data from new API? Returns previous value
Hi, i want achieve scenario:
User select value => selected value passed to QueryClient => updated value from QueryClient used to refetch data (new value used for api call)
Component, which sets initial data
Component, which needs to update it's state, based on fetched data
Component, which should trigger updating the previous component
However this is not working as expected.
1. Value in QueryClient is updating fine (checked in devtools)
2. Refetching is initialised fine
3. BUT Refetching returns initial data, completely ignoring new
displayCurrency
value. It also does not update if i select different values multiple time, but refetching initialise each time i select new value.
It is refetch correctly(returning new values) only after some time(i guess when periodic refetch is happening).
Please, help me figure this out0 Replies