TanStackT
TanStack10mo ago
32 replies
dead-brown

Using URL search params with prerendered route

Here's a personal project that uses a static createServerFn for data with route prerendering. The itemHeight search state controls the adjustable height of each gradient list item. As result of the prerendering, the default itemHeight is always rendered on initial page load breaking the adjustable height feature.

Id be fine just using SSR here, but when prerendering is disabled I get build errors - I assume because of the static createServerFn expects prerendering to be on. Using a regular createServerFn solves my problem, but then the returned data isn't bundled at build time as static json.

Is it possible to use url search state with prerendering/static createServerfn? Perhaps with something similar to how theming is done Darkmode/Themes with Start? using the ScriptOnce component?
Use Grabient, a cosine gradient generator, to create custom CSS gradients and discover inspiring color palettes. Perfect for designers and developers.
Was this page helpful?