react-query-questions
solid-query-questions
table-questions
virtual-questions
router-questions
react-charts-questions
ranger-questions
vue-query-questions
svelte-query-questions
bling-questions
form-questions
angular-query-questions
start-questions
db-questions
start-showcase
router-showcase
📣-announcements
Migrating v4 to v5 give me couple of errors on some of the queries
codemod
in the docs. After running it, I get some queries where I have to manually migrate te query. But I'm having problems understanding the error and how to migrate them. For example
```ts
// v4...onSuccess analogue in queries?
query key problem
seeding-the-query-cache
Transpile react-query in Next.js
TypeError: (intermediate value)(intermediate value)(intermediate value) is not a function
on the client.Usequeries results referencing
useMutation Hook triggers rerender of component when a non-related subscription receives new data

setState
ChatNotificationsProvider
) while rendering a different component (Navbar
). To locate the bad setState() call inside Navbar
and the same goes to the NotificationsProvider when i try to set state to the context and i dont understand how to prevent this error
prefetchQuery has old data on page refresh
AI chatbot for user support
Dynamically prefix all queryKeys
account_id
the JWT is issued for. E.g. posts.list
returns posts only for the authorised account_id
without having to specify any filters, etc.
Is there a good way to dynamically transform all query keys and prefix them with the account_id
, so that we wouldn't have to manually update all queries to do so, and avoid us missing to add it, in which case we can accidentally display stale data from a previously loaded account. I know we could flush the cache every time the account_id
changes, but would much prefer to keep the caching in place....HMR/Vite hot code reload clears entire cache
setQueryData
after running a mutation, so I used the dev tools to look at the query data. It seems like after every Hot Module Reload triggered by vite, the entire query cache is wiped, and even though my interface still displays the data, calls to setQueryData
will no longer affect it (oldData
, the first argument to the update function, is always undefined
, even if the data is currently being displayed on screen), and the devtools won't show any queries in the cache at all.
I haven't found any information about how this is supposed to work - is this expected behavior or am I missing something? I can provide more data about my setup and configuration files if needed, but it's pretty much taken straight from the examples....Does ReactDom's flushSync works with setQueryData in same way as it works with setState()?
flushSync
API from React DOM can be used to sync DOM to state updates synchronously, Can we wrap setQueryData
call for a active
query in flushSync
callback and expect to access the updated DOM for scrolling etc?
```
...What if I need to pass custom information to my query function?
fetchNextPage
doesn't do anything and the data gets lost anyways. This feature is crucial for me, as I'm implementing a kanban board, where each kanban stack will be infinitely scrollable. My API can work in two ways:
- I can fetch data for all stacks at once, which is very convenient when doing initial data fetching
- I can specify which stack I want to fetch next, which is convenient when scrolling one of the stacks and trying to fetch more data for it...Is there a chance to reload part of a query only?
Dependee useQueries only randomly executing, despite successful dependend useQuery result
onMounted
call:
```
const { isSuccess, isError, data: assetManagerEvents } = useQuery(
{...isPending always false and status always 'idle'
isPending
never changes to true and status
is always "idle". Can anyone spot why?
```
function ProfileImageModal() {
const { toast } = useToast()...Dynamically modifying queryKeys?
How to handle nested objects without re-render the whole app?
