You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a zustand store with some global filters, like a selected destination. When the user navigates to '/booking' the loader function fetches bookings based on this filter.
loader: async ({ context, deps }) => {
const destinationId = deps.destinationId; // contains the value, but gives ts error as deps is {} according to typescript
await context.queryClient.ensureQueryData(bookingQueries.bookings(destinationId));
},
The problem is that this doesn't rerun when a new filter value is set. What's the best way to solve this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a zustand store with some global filters, like a selected destination. When the user navigates to '/booking' the loader function fetches bookings based on this filter.
If the user changes the selected destination to something else, I'd like to rerun the loader, so I tried adding the loaderDeps property like this:
The problem is that this doesn't rerun when a new filter value is set. What's the best way to solve this?
Beta Was this translation helpful? Give feedback.
All reactions