How glennreyes/react-countup works
React CountUp is a small React wrapper around CountUp.js. A consumer uses either the renderable CountUp component or the useCountUp hook, supplies a target and animation options, then starts or lets the counter run and can use controls and callbacks. The component delegates animation lifecycle to the hook; the hook builds and controls the CountUp.js instance. The README documents options including formatting, delays, scroll-spy, plugins, and lifecycle callbacks. The graph reflects the sampled runtime; the README establishes capabilities whose internal implementation was not sampled.
Main entry points: useCountUp.ts useCountUp hook · common.ts Instance factory · CountUp.tsx CountUp component · index.ts Package exports
Components 9
React API
- CountUp component
src/CountUp.tsx - useCountUp hook
src/useCountUp.ts - Package exports
src/index.ts
Counter runtime
- Instance factory
src/common.ts - Stable callbacks
src/helpers/useEventCallback.ts - Isomorphic effect
src/helpers/useIsomorphicLayoutEffect.ts - API types
src/types.ts
Other components
- React consumer
- CountUp.js
Connections 12
- React consumer → CountUp component: renders
README.md - React consumer → useCountUp hook: uses
README.md - CountUp component → useCountUp hook: delegates to
src/CountUp.tsx - useCountUp hook → Instance factory: creates instance
src/useCountUp.ts - Instance factory → CountUp.js: constructs
src/common.ts - useCountUp hook → CountUp.js: controls
src/useCountUp.ts - useCountUp hook → Stable callbacks: uses
src/useCountUp.ts - Stable callbacks → Isomorphic effect: updates via
src/helpers/useEventCallback.ts - useCountUp hook → API types: uses types
src/useCountUp.ts - Instance factory → API types: uses types
src/common.ts - Package exports → CountUp component: exports
src/index.ts - Package exports → useCountUp hook: exports
src/index.ts