Installation
npm
npm install medhira-react-typescript-hooks
yarn
yarn add medhira-react-typescript-hooks
pnpm
pnpm add medhira-react-typescript-hooks
Peer dependency
React 18 or newer is required:
npm install react@^18
TypeScript
Types ship with the package. No @types/* package is needed.
{
"compilerOptions": {
"strict": true,
"jsx": "react-jsx"
}
}
Module formats
| Environment | Resolution |
|---|---|
| ESM bundlers (Vite, webpack 5+) | import → dist/esm |
| CommonJS | require → dist/cjs |
Import only from the package name:
import { useDefaultReducer } from 'medhira-react-typescript-hooks';