Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
23233 opened this issue May 12, 2024 · 1 comment
Closed

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

23233 opened this issue May 12, 2024 · 1 comment

Comments

@23233
Copy link

23233 commented May 12, 2024

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

@23233 23233 changed the title Can export const router ? Can export const router ? how to set basepath? May 12, 2024
@oedotme
Copy link
Owner

oedotme commented May 12, 2024

@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} />

@oedotme oedotme closed this as completed May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants