SSR loading state
I have a page with data table. Page has search params, like
page, limit, sort and order.I want to achieve the behavior that:
1. If user loads page
http://localhost:3000/table?page=1&limit=20&sort=name&order=ascthen the page is ssr-ed to them
2. If user changes
sort, order or page on the page by clicking on some button in the table header etc., I want a small spinner or something to show up while the new data is being fetched. Currently my route looks like that:
Then in the component,
But this results in behavior that when user clicks sort icon, nothing happens for ~0.5 second while the new data is being fetched and SSR-ed, and then, after 0.5 seconds the page changes.
I still want it to be ssr-ed, for SEO purposes, but I also want loading state fire if user changes sorting, page, etc.