Skip to content
Discussion options

You must be logged in to vote

You can use Route meta option to carry extra data in basically any format you like. Example from my app, where I add Breadcrumbs to meta:

export const appIndexRoute = new Route({
	getParentRoute: () => appRoute,
	meta: {
		Breadcrumb: () => {
			const LL = useLL();

			return <Breadcrumb>{LL.app.dashboard.name()}</Breadcrumb>;
		},
		getTitle: LL => LL.app.dashboard.name(),
	},
	path: "/",
}).update({
	component: lazyRouteComponent(async () => import("#/routes/_app._index/_page"), "AppIndexPage"),
});

and then access them and create an array of components to render

	const matches = useRouterState({ select: state => state.matches });
	const router = useRouter();

	const breadcrumbs = useMemo(

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@MrAdam
Comment options

@ArturBaybulatov
Comment options

Answer selected by McDaddy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants