Prerendering and query params
In the below example, the list will not be sorted as expected when initially visiting
/?sort=true
, only if I navigate to another page first so that CSR has taken over. It works fine with the dev server so I believe this is an issue with SSG/pre-rendering. My content is completely static so I ideally would like to avoid SSR, is there any way to get this working with SSG/pre-rending or is it just a fundamental limitation?
I am using Solid Start with the following config.
2 Replies
During SSR the server will just serve the pre-rendered html file.
You could prerender
routes:"/?sort=true"
Or try to set the searchparams again in onMount
Thanks! In my actual app I am actually using the current time to determine the sort order so pre-rendering "/?sort=true" wouldn't work for SSG. I will have a look into using onMount.