SolidJSS
SolidJSโ€ข10mo agoโ€ข
12 replies
quangnguyen1311

SSR doesn't auto fetching data when CSR

Hi,
Currently, I've create some routes for SSR purpose and they work perfectly.
However, If I go to the page SSR then navigating through some page and back to the SSR page the data SSR before is loss.

const productsLoad = query(async () => {
  return await productService.getLatestProductList([]);
}, "products");

export const route = {
  preload: () => productsLoad(),
} satisfies RouteDefinition;

export default function HomePage() {
  const products = createAsync(() => productsLoad());
  console.log(products());

///other code


Do I need do other step to ensure keep the data for the page? Or need something to switch from SSR to CSR during navigating?
Was this page helpful?