Skip to main content
Version: Next

Installation

Package manager​

Install the npm package:

npm install react-mnemonic

Install a specific version only when you need to pin your app to a particular release line:

npm install react-mnemonic@1.3.0

Peer dependencies​

React 18 or later is required. CI verifies packaged-consumer installs against React 18 and React 19.

{
"peerDependencies": {
"react": ">=18",
"react-dom": ">=18"
}
}

What's included​

The package ships:

FormatFileUsage
ESMdist/index.jsModern bundlers (Vite, esbuild, webpack 5+)
CJSdist/index.cjsNode.js / legacy bundlers
Typesdist/index.d.tsTypeScript declarations

The library is tree-shakeable, has zero runtime dependencies, and is SSR-safe by default. Without extra configuration, hooks render defaultValue on the server and then hydrate to persisted storage on the client.

Published entrypoints​

The package publishes multiple subpath entrypoints so apps can pay for the surface they actually use:

Import pathPrimary ESM fileApprox ESM sizeUse when
react-mnemonicdist/index.js~84.6 KBYou want the top-level full entrypoint
react-mnemonic/coredist/core.js~65.3 KBA provider is required and you want the lean persisted-state path
react-mnemonic/schemadist/schema.js~84.6 KBYou want schema validation, autoschema, and migrations
react-mnemonic/optionaldist/optional.js~5.2 KBA reusable component should persist when a provider exists and fall back locally
react-mnemonic/bootstrapdist/bootstrap.js~24.5 KBYou need synchronous recall before React first renders

These are rough current estimates from the built ESM entry files in dist/ before consumer-side minification and tree-shaking. They are useful for relative comparison, not as a hard size guarantee.