How epifanovmd/anchor-list works
AnchorList is a virtualized React Native list that preserves the visible row by key as content changes. The principal flow is consumer configuration into the list component and runtime, which computes visible items and coordinates scrolling, measurement, and layout; rendered containers then display the selected rows. Separate capabilities cover sticky anchors, edge-triggered loading, keyboard/end insets, viewability, public state hooks, diagnostics, and performance reporting. The graph follows the README and available import references; several internal feature modules were not sampled, so their runtime links are documented or left out rather than inferred.
Main entry points: AnchorList.tsx AnchorList API · list-runtime.ts List runtime · index.ts Public exports · list-perf.ts Performance tracking
Components 28
Public interface
- AnchorList API
src/components/AnchorList.tsx - Public exports
src/index.ts - State hooks
src/hooks/useListSharedValues.ts
Rendering and state
- List store
src/model/list-store.ts - Container binding
src/core/layout/container-binder.ts - Visible containers
src/components/ListContainers.tsx - Item container
src/components/ListItemContainer.tsx - Axis layout
src/components/axis.ts - List slots
src/components/list-slots.ts
List engine
- List runtime
src/core/runtime/list-runtime.ts - Item metrics
src/model/metrics/list-metrics.ts
List features
- Scroll handler
src/hooks/useListScrollHandler.ts - Scroll adjustment
src/components/ListScrollAdjust.tsx - Item offsets
src/core/scroll/item-offset.ts - Position preservation
src/core/mvcp/mvcp.ts - Edge loading
src/core/edges/edge-thresholds.ts - Sticky anchors
src/components/ListStickyOverlay.tsx - Sticky placement
src/components/sticky-placement.ts - End inset
src/hooks/useInsetEnd.ts - Item visibility
src/core/viewability/viewability.ts
Diagnostics and metrics
- Debug channels
src/debug/debug-channel.ts - Debug registry
src/debug/debug-registry.ts - Debug formatting
src/debug/debug-format.ts - Performance tracking
src/perf/list-perf.ts - Frame monitor
src/perf/frame-monitor.ts - Performance metrics
src/perf/list-perf-metrics.ts - Performance report
src/perf/list-perf-report.ts
Other components
- App developer
Connections 31
- App developer → AnchorList API: configures
README.md - AnchorList API → List runtime: updates runtime
src/components/AnchorList.tsx - AnchorList API → Visible containers: renders
src/components/AnchorList.tsx - AnchorList API → End inset: uses inset hook
src/components/AnchorList.tsx - AnchorList API → State hooks: publishes values
src/components/AnchorList.tsx - AnchorList API → Sticky placement: applies edge inset
src/components/AnchorList.tsx - Visible containers → Item container: renders items
src/components/ListContainers.tsx - Visible containers → Axis layout: styles slots
src/components/ListContainers.tsx - AnchorList API → List slots: renders slots
src/components/AnchorList.tsx - List runtime → List store: updates state
src/core/runtime/list-runtime.ts - List runtime → Item metrics: uses metrics
- List runtime → Container binding: binds containers
src/core/runtime/list-runtime.ts - Container binding → Item metrics: positions items
src/core/layout/container-binder.ts - AnchorList API → Scroll adjustment: renders adjustment
src/components/AnchorList.tsx - List runtime → Position preservation: captures position
src/core/runtime/list-runtime.ts - Position preservation → Item offsets: resolves item offset
- Scroll handler → List runtime: reports scrolling
src/hooks/useListScrollHandler.ts - List runtime → Edge loading: checks thresholds
src/core/runtime/list-runtime.ts - AnchorList API → Sticky anchors: renders overlay
src/components/AnchorList.tsx - AnchorList API → Scroll handler: handles scrolling
- List runtime → Item visibility: tracks visibility
- Public exports → AnchorList API: exports
src/index.ts - Public exports → State hooks: exports hooks
src/index.ts - Public exports → Debug registry: exports diagnostics
src/index.ts - Debug channels → Debug formatting: formats events
src/debug/debug-channel.ts - Debug channels → Debug registry: registers channels
src/debug/debug-channel.ts - List runtime → Debug channels: logs events
src/core/runtime/list-runtime.ts - Public exports → Performance tracking: exports tracking
src/index.ts - Performance tracking → Frame monitor: monitors frames
src/perf/list-perf.ts - Performance tracking → Performance metrics: collects metrics
src/perf/list-perf.ts - Performance tracking → Performance report: builds reports
src/perf/list-perf.ts