react-nav-router
v1.0.0
Published
Lightweight iOS-style stack router for React 18.
Readme
react-nav-router
Lightweight iOS-style stack router for React 18.
Documentation & live demos: https://n43.github.io/react-nav-router/
Install
pnpm add react-nav-routerPeer: react@>=18, react-dom@>=18.
Quick start
import { createRouter, NavRouter } from 'react-nav-router';
const router = createRouter({ rootRoute: '/', history: 'hash' });
export default function App() {
return <NavRouter router={router} render={(p) => <Page path={p} />} />;
}Features
- iOS-style push / pop / replace transitions
willAppear/didAppear/willDisappear/didDisappearlifecycle- Hash-mode history binding with
popstate/hashchangehandling customNavigationhook for per-app stack policies- Tiny — zero runtime dependencies, tree-shakeable
Development
pnpm install
pnpm test # unit tests (57 tests)
pnpm e2e # playwright e2e (requires docs:build first)
pnpm docs:dev # live docs site at localhost:5173
pnpm build # produce dist/Docs deployment
First-time: repo Settings → Pages → Source = "GitHub Actions".
Subsequent pushes to main deploy automatically via docs.yml.
License
MIT
