wouter
wouter is a minimalist routing library for React and Preact, only about 2.1KB minified, far smaller than React Router's 18.7KB. It provides a Hook-based API (such as useLocation, useRoute, useRouter) as well as React Router-like components (Route, Link, Switch, Redirect), and supports nested routing, dynamic parameters, query strings, hash routing, memory routing, and SSR. No top-level Router component is required, and you can flexibly choose how to use it. It is suitable for React/Preact projects that pursue lightweight solutions and are familiar with Hooks.