TanStackT
TanStack9mo ago
2 replies
colossal-harlequin

File Route Component Best Practices

Hello, I would like to ask if there are any best practices with regard to File Routes/Components

Should a route file be a dumb wrapper around a component?

Should the route file reference a separate component? If not, should the component inside the route file be named RouteComponenet, or a name similar to the route?

Just asking these questions to ensure I’m building the way it was intended to be done

E.g.

export const Route = createFileRoute("/dashboard/chat")({
  component: RouteComponent,
});

function RouteComponent() {
  return (

        <Chat />
  
  );
}
Was this page helpful?