JavaScript library for managing browser session history anywhere JavaScript runs. Current stable version is v5.3.0 (2022-01-15, last release as of 2025). v5 is a complete rewrite with TypeScript support, breaking changes from v4/v3 including renamed exports (e.g., createBrowserHistory instead of createHistory) and removal of the createHistory function. Key differentiator: React Router's underlying history manager; abstracts differences between browser, hash, and memory history. Release cadence: infrequent, no recent activity. v4 is deprecated in favor of v5.
npm install history-plusNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a browser history, listens for location changes, and pushes a new entry with state.
Replace `createHistory` with `createBrowserHistory` (for HTML5 history) or the appropriate variant.
Cast `location.state` to your expected type: `location.state as MyState`.
Replace `PartialPath` with `Partial<Path>` and `PartialLocation` with `Partial<Location>`.
Use a bundler (webpack, rollup, etc.) or import from ESM CDN like esm.sh: `import { createBrowserHistory } from 'https://esm.sh/history'`.Update blocking logic: use `const unblock = history.block(prompt);` and `unblock.retry()` to retry.
Use `createBrowserHistory` (or `createHashHistory`/`createMemoryHistory`) instead.
Remove references to LocationState; cast location.state as needed.
Ensure you have history@5.0.0 or later. Import types: `import type { BrowserHistory } from 'history'`.No dependency data recorded yet.