How to retrigger the pendingComponent when using `useSuspenseQuery`
Hello everyone! I have a posts component that is a list of posts, and a button that caps the limit of the amount of posts to 10. When loading this route initially I have a
pendingComponent
that reveals my pending ui. When I click the limit button I want to retrigger this pending UI, and then rerender the data in my component with the updated data
What actually ends up happening is that it refetches my /api/posts
endpoint, and then the component rerenders, but the pendingComponent
doesn't come back or show.
Here's my component structure
and then my component:
Another approach to get around this is instead of navigate
I call refetch
and write additional pending UI in my PostsComponent
by using isRefetching
, but Ideally I want to show the pending component in the suspense boundary
Is there any way around this? Do I have the right approach? Thanks in advance0 Replies