medhira-react-typescript-hooks
v0.0.1
Published
Custom React hooks for faster development - Powered by MEDHIRA
Maintainers
Readme
medhira-react-typescript-hooks
Custom React hooks for making development easier, faster, and more performant.
Why MEDHIRA?
- useDefaultReducer - Simplified state management
- TypeScript Ready - Full type definitions
- Lightweight - Zero dependencies
- React 18+ - Compatible with latest React
Installation
npm install medhira-react-typescript-hooks
# or
yarn add medhira-react-typescript-hooksAvailable Hooks
useDefaultReducer
Simple state management hook.
Parameters
| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| initialState | object | Initial state object | Yes |
Returns
| Return | Type | Description |
|--------|------|-------------|
| state | object | Current state |
| multipleAction | function | Update state with object |
Example
import { useDefaultReducer } from 'medhira-react-typescript-hooks';
const initialState = {
email: null,
password: null
};
function LoginForm() {
const { state, multipleAction } = useDefaultReducer(initialState);
return (
<input
value={state.email}
onChange={(e) => multipleAction({ email: e.target.value })}
/>
);
}Contributing
Contributions welcome!
Sponsor & Support
- GitHub: https://github.com/HELLOMEDHIRA
- Email: [email protected]
About MEDHIRA
MEDHIRA - Engineering Intelligence Across Everything
- Website: https://medhira.readthedocs.io/en/latest/
- GitHub: https://github.com/HELLOMEDHIRA
License
Apache 2.0
Made with passion by MEDHIRA
