Skip to content

dzek69/ezez-hooks

Repository files navigation

@ezez/hooks

React hooks like no other! ⚡

Use alongside other great libraries, there are no plans to reproduce all "common" hooks. If a hook is there, it's either unique, rare, super optimized or just needed for other hooks.

Features:

  • 💪 useConditionalHooks - break the rules (safely) — call hooks conditionally, use a dynamic list of hooks
  • 🪄 useEffect2 - useEffect that gives you previous values
  • useBusy - keep track of your async operations
  • 📨 useCrossTabs - hook for cross-tab communication
  • 📨 useCrossTabsMessage - easily listen to messages from other tabs
  • 2️⃣ useDetectMultiTabs - detect if there are multiple tabs of your app open
  • 🔄 useForceUpdate - force render on demand
  • 🌐 useGeolocation - keep track of user's geolocation (super optimized)
  • 🌐 useSimpleGeolocation - keep track of user's geolocation (simplified)
  • ☝️ useInputDevice - keep track of a currently active input device
  • 🥇 useIsFirstRender - keep track of first render
  • 🎭 useProxyRef - wraps your ref with a Proxy for full control
  • 🎭 useForwardedProxyRef - wraps forwarded ref with a Proxy for full control
  • 📅 useToday - keep track of day changes
  • 🔄 useUpdateEvery - force render every interval set

Batteries included:

  • 🛠 First class TypeScript support - 100% type safe and intellisense friendly
  • 🌎 Universal - exposes both ESM modules and CommonJS

Usage

Full documentation is available here: documentation.

Promotion

  • How to call hooks conditionally - the only solution that takes care of the pitfalls
  • React Hook is Called Conditionally [SOLVED]
  • useEffect previous value
  • useEffect list of changes

License

MIT

About

React hooks you've always wanted but never knew were possible.

Resources

License

Stars

Watchers

Forks