Routing

FileRoutes

Edit this page

FileRoutes is a component that creates a Route for each file in the /src/routes directory. This creates a route export to define the route configuration for the router of your choice.

For example, using solid-router would look like the following:

app.tsx
import { Suspense } from "solid-js";
import { Router } from "@solidjs/router";
import { FileRoutes } from "@solidjs/start/router";
export default function App() {
return (
<Router root={(props) => <Suspense>{props.children}</Suspense>}>
<FileRoutes />
</Router>
);
}

See the SolidStart routing guide for more details.

Report an issue with this page