Relative Content

Tag Archive for reactjsrtk-query

rtk-query having problem settting context value

I am using rtk-query to fetch data from API. I also have context that I am using for child components. Problem that I am facing is that context gets rendered before data is finished fetching. Here is my code:

RTK Query get query cached params

params will be set to default after unmount and then mount a component, but it cause a duplicates for every time when I unmount and then mount a component and useGetUsersQuery still has a cached data. I need somehow keep in store also params to be up to date with cached data. Also this params should expire in same time as useGetUsersQuery cached data expire.