Library
Routingpreact-router
Lightweight router for classic Preact single-page applications.
Native PreactActive
Native Preact
Built for Preact and does not require a React compatibility layer.
Packagepreact-router
npm install preact-routerimport Router, { Route } from "preact-router"; export function App() { return ( <Router> <Route path="/" component={() => <h1>Home</h1>} /> <Route path="/about" component={() => <h1>About</h1>} /> </Router> );}Known limitations
- The project is mature but not the best fit for newer SSR-heavy application architectures.
Introduction
`preact-router` stays attractive for small SPAs where you want a familiar, minimal routing API.
Preact configuration
No special setup is required beyond importing the router.
SSR notes
This package targets client-side navigation first. SSR workflows usually prefer `preact-iso` or custom routing solutions.
Islands notes
Not typically used as an islands-first router.