TanStackT
TanStack3mo ago
1 reply
wet-aqua

How to get Route Type from Tanstack Start route tree gen

I am building a sidebar, thats configured by a const. I have the following type

import { FileRoutesByFullPath } from '@/routeTree.gen';
import { type LucideIcon } from 'lucide-react';

export type SidebarData = {
  navMain: {
    title: string;
    url: keyof FileRoutesByFullPath;
    icon?: LucideIcon;
    isActive?: boolean;
    items?: {
      title: string;
      url: keyof FileRoutesByFullPath;
    }[];
  }[];
};


I get a type error when passing in the URL to a <Link> component from react-router. Is this the correct way to do this?
Was this page helpful?