I have an app that uses pagination with RSC. The query parameters are passed from Next.js straight to an API endpoint which returns the result set.
I can't seem to find a way to show a loading UI when paginating. I have the same issue for things like filters which appear on the page. When clicking a pagination button, I programmatically update the search params (because filters need to stay in place) and use router.replace to update the URL. This works, but the new UI only shows after 1 second or so, because the API isn't fast.
What is the best way to get a loading UI here? Suggestions online seem to only help when fetching data directly on the client, which I don't want.