`useInfiniteQuery` stalls at 'pending' status in NextJS App
Hi everyone, I've been trying to get a custom hook to work for a while now. The hooks is just a wrapper around
useInfiniteQuery
which helps me get some data which I want to render out on the screen.
Here's what I'm currently trying:
I commented out the bit of code I wanted to work and just mocked the response from the call, but even so, the status of the request remains 'pending' (on the browser) forever.
The app is a NextJS App (v14.0.4) w/ app router
4 Replies
foreign-sapphire•2y ago
Can you show a reproduction please?
genetic-orangeOP•2y ago
okay, here's the hook:
and here's where I'm applying it:
foreign-sapphire•2y ago
something I can execute, like a stackblitz or codesandbox please ...
genetic-orangeOP•2y ago
ohhh, okay, On it
Sorry for the late response.... I was unable to replicate the setup in a codesandbox
Mostly because the project is a monorepo which references other internal projects
But I have been able to figure out where the issue is coming from
It's coming from the payload object I'm passing into the query key
So I just stringifyied the object before supplying it as a query key
And it's working fine