Wouter is a minimalist router for React and Preact that relies on Hooks and weighs approximately 2.4 kilobytes minified and gzipped.
The tool solves the problem of adding routing to React and Preact applications without the overhead of larger routing libraries. It provides a hook-based API alongside familiar component-based patterns, allowing developers to choose between declarative routing with Route, Link, Switch, and Redirect components, or more granular control through useLocation, useRoute, and useRouter hooks. The router does not require a top-level Router component wrapper, making it optional and flexible for different project structures.
Wouter suits projects where bundle size matters and developers prefer a minimal, straightforward routing solution. It works well for small to medium applications and integrates naturally with modern React patterns built around hooks. The README positions it as an alternative to React Router, emphasizing that it accomplishes the same routing goals while maintaining a simpler, more minimalist API without sacrificing convenience. The tool supports both React and Preact, making it useful for projects targeting either framework.
The project maintains a strict size constraint with automated checks enforcing a 2.5 kilobyte limit. Development includes comprehensive test coverage and active maintenance across multiple framework versions. The codebase is written in TypeScript and has been adopted by several notable projects in the React ecosystem.