
A collection of React hooks commonly used in Decentraland projects.
react >= 18.0.0
decentraland-crypto-fetch >= 2.0.0 (only needed for useNotifications).
Version 3 signs the ADR-44 payload with the metadata bytes bound into the signature and
requires Node >= 22; version 2 does neither. npm installs the highest match, so pin the
major your app targets if that matters to you.
| Hook |
Description |
Docs |
useAsyncState |
Async state management with auto-reload on dependency changes |
docs |
useAsyncMemo |
Alias for useAsyncState |
docs |
useAsyncEffect |
Async version of useEffect with error tracking |
docs |
useAsyncTask |
Single imperative async task with loading state |
docs |
useAsyncTasks |
Multiple concurrent async tasks managed by ID |
docs |
usePatchState |
Partial state updates for complex objects |
docs |
useInfiniteScroll |
Infinite scroll with debounce and threshold |
docs |
useAdvancedUserAgentData |
Browser, OS, CPU, and device detection |
docs |
useAnalytics |
Segment analytics tracking (requires AnalyticsProvider) |
docs |
usePageTracking |
Page view tracking (requires AnalyticsProvider) |
docs |
useTranslation |
i18n with ICU message syntax via @formatjs/intl |
docs |
useNotifications |
Decentraland notification polling and modal state |
docs |
| Provider |
Description |
Docs |
AnalyticsProvider |
Segment analytics context |
docs |
TranslationProvider |
i18n context for useTranslation |
docs |
| Export |
Description |
Docs |
getStorageItem / setStorageItem / removeStorageItem |
Typed localStorage helpers with JSON serialization |
docs |
createNotificationsClient |
Decentraland notifications API client |
docs |
- docs/ -- Detailed per-hook documentation with examples
- AGENTS.md -- Compact API reference for LLM/AI consumption
- docs/contributing.md -- Contribution guide and internal patterns
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.