#"createRouter is not a function" after updating to `@tanstack/react-router-ssr-query`

5 messages · Page 1 of 1 (latest)

thorny spindle
#

Here is my router.tsx file

import { QueryClient } from "@tanstack/react-query";
import { createRouter } from "@tanstack/react-router";
import { setupRouterSsrQueryIntegration } from "@tanstack/react-router-ssr-query";
import { routeTree } from "./routeTree.gen";

export function createAppRouter() {
  const queryClient = new QueryClient();
  const router = createRouter({
    routeTree,
    // optionally expose the QueryClient via router context
    context: { queryClient },
    scrollRestoration: true,
    defaultPreload: "intent",
  });

  setupRouterSsrQueryIntegration({
    router,
    queryClient,
  });

  return router;
}
silver willow
#

Should it be createRouter instead of createAppRouter?

thorny spindle
stiff quartz
#

anyhow, this interface will change soon