oedotme / generouted

Generated file-based routes for Vite
https://stackblitz.com/github.com/oedotme/generouted/tree/main/explorer
MIT License
1.04k stars 48 forks source link

Can export const router ? how to set basepath? #168

Closed 23233 closed 5 months ago

23233 commented 5 months ago

Describe the Bug

routes.gen.tsx no export const router = createRouter({ routeTree: config });

but i want to set basepath , what can i do it?

            <RouterProvider router={router} basepath={"/admin"} />

Generouted Version

"@generouted/tanstack-react-router": "^1.19.3",

Your Example Website or App or Reproduction

no

Steps to Reproduce the Bug or Issue

you konw

Expected Behavior

export const Routes = () =>

Screenshots or Videos

No response

Platform

window

Additional context

No response

oedotme commented 5 months ago

@23233 The routes tree/object is now exported at v1.19.4

You can now use it directly to customize the router:

import { routes } from './routes.gen'

const router = createRouter({ routeTree: routes })
const Routes = () => <RouterProvider router={router} />