T
TanStack4mo ago
deep-jade

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

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

function RouteComponent() {
return (

<Chat />

);
}
1 Reply
quickest-silver
quickest-silver4mo ago
you can do whatever you want here it's a matter of project structure / taste

Did you find this page helpful?