Custom Hooks Logo

@uiblock/hooks

A collection of modern, reusable, and production-ready React custom hooks

View All Hooks →
npm install @uiblock/hooks
📦 npm

🌐Browser APIs

High-signal hooks for senior frontend interviews

View all 7

useIntersectionObserver

Detect when an element enters the viewport

useResizeObserver

Track element size changes in real-time

useMutationObserver

Observe DOM mutations and changes

useGeolocation

Track user position with automatic cleanup

useMediaQuery

Dark mode, mobile/desktop detection

useOnlineStatus

Network detection with offline queue sync

Performance

Build efficient hooks for large-scale applications

View all 7

useThrottle

Limit function calls for scroll/resize events

useDebounce

Delay execution for search and form validation

useEventListener

Prevent memory leaks with auto-cleanup

useAnimationFrame

Smooth animations and visual updates

usePrevious

Track previous state/props efficiently

useDeepCompareEffect

Prevent infinite re-renders with deep comparison

🔄Data Fetching

System design style hooks for production applications

View all 5

useFetch

Robust fetching with retries and caching

useAsync

Generic wrapper for any promise function

usePoll

Polling API with pause/resume

useWebSocket

WebSocket with reconnection logic

useQueryParams

Sync URL params with component state