What problem does it solve?
Provides concise, predictable primitives to manage local reactive state, memoized computations, persistent references, host element access, forced updates, stable IDs, and low-level hook composition inside Atomico web components, avoiding ad-hoc state and DOM handling and differentiating from React hook semantics.
Core Features & Use Cases
- Local state management with useState for reactive component values and strict equality setter behavior.
- Performance primitives including useMemo and useCallback for caching expensive computations and stable function references.
- DOM and lifecycle utilities such as useRef for element refs, useHost for accessing the custom element, useUpdate to force re-renders, useId for stable identifiers, and useHook to build custom hooks.
- Use Case: Implement an accessible form component that uses useId for labels, useRef to focus inputs, useState for controlled values, and useMemo to compute validation results efficiently.
Quick Start
Import the Atomico hooks into your component and replace ad-hoc state and DOM logic with useState, useRef, useHost, useMemo, and useHook as needed.