How to indicate loading during pagination (using query parameter) with RSC and loading.tsx? #55481
Replies: 6 comments 1 reply
-
|
Same problem. |
Beta Was this translation helpful? Give feedback.
-
|
Same problem here |
Beta Was this translation helpful? Give feedback.
-
|
same problem here |
Beta Was this translation helpful? Give feedback.
-
|
I managed to solve it by following the solution here. I did something similar because, at first, I put it at the root // page.jsx
import { v4 as uuidv4 } from 'uuid';
export default function Page() {
return (
<div>
<div>
{/* Other component */}
</div>
{/* I put a uuid as the key, and everything worked. /*}
<Suspense key={uuidv4()} fallback="Loading...">
<ComponentWithPagination />
</Suspense>
</div>
);
}This person also mentioned it here. |
Beta Was this translation helpful? Give feedback.
-
|
have you managed to find solution? |
Beta Was this translation helpful? Give feedback.
-
|
Wrapping the page change inside useTranstion worked for me, the data is being fetched in server component and with each page change I show loader based on isPending. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am trying to implement pagination using RSC and
loading.tsx. I render items on the server based on?page=<number>query parameter.The problem is client side/soft navigation - when I click on
<Link href={`/?page=${page + 1}`}>Next</Link>nothing happens for 3 seconds (fake delay in data fetching).next.mov
Is there a way how to indicate that items are loading?
Once I click the link I would expect the
loading.tsxto "kick in" and show the loading page immediately. But that is not happening and I get no feedback for those 3 seconds.At first glance this #43548 seemed to be my issue, but I reckon this is something else - this issue was related to dynamic pages (pages that use
[dynamicSegments]/page.tsx) - this is not my case. Besides the problem in this issue was on Vercel side.Any advice 🙏 ?
I have the following setup:
Beta Was this translation helpful? Give feedback.
All reactions