Routes
Render the active route component, fallback, or error boundary.
Compatibility
ReactAvailable in this renderer's browser integration.
React SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.
PreactAvailable in this renderer's browser integration.
Preact SSRAvailable to this renderer's SSR integration; browser event handlers run after hydration.
Import from @kasperrt/smolter/react @kasperrt/smolter/preact
Signature
function Routes({ fallback }: RoutesProps): ReactNode;Parameters
fallback is optional content for cases where no route component can render. It defaults to null.
Returns
The active module default export, HydrateFallback, ErrorBoundary, error message, or fallback.
Usage
Import this API from one of the entry points listed above. Keep server and build helpers in their dedicated subpaths.
<Routes fallback={<p>No page here.</p>} />Behavior and edge cases
The component reads the router from RouterProvider. It renders one matched module, not a nested outlet tree. Completed page content stays mounted through revalidation. Components receive no automatic loaderData prop: use the data hooks.