@tesserix/hooks
v1.0.0
Published
Tesserix Design System - Cross-platform React hooks for web and React Native
Downloads
230
Maintainers
Readme
@tesserix/hooks
Cross-platform React hooks for web and React Native applications.
Installation
npm install @tesserix/hooks
# or
pnpm add @tesserix/hooks
# or
yarn add @tesserix/hooksUsage
import { useToggle, useAsync, useDebounce } from '@tesserix/hooks'
function MyComponent() {
const { value, toggle } = useToggle()
const debouncedValue = useDebounce(searchTerm, 300)
// ... your component logic
}Available Hooks
State Management
useToggle- Boolean state with helper methodsuseAsync- Async operation state managementusePrevious- Track previous valueuseBoolean- Boolean state with semantic helpersuseCounter- Counter with increment/decrementuseArray- Array manipulation helpersuseMap- Map state managementuseSet- Set state management
Timing
useDebounce- Debounce valuesuseInterval- setInterval wrapperuseTimeout- setTimeout wrapperuseThrottle- Throttle values
Lifecycle
useOnMount- Execute on component mountuseOnUnmount- Execute on component unmountuseMounted- Check if component is mounteduseEffectOnce- Run effect only onceuseUpdateEffect- Skip first render
Form & Input
useForm- Form state management
Platform Compatibility
All hooks in this package are cross-platform and work with both React (web) and React Native.
License
MIT
