Skip to content

Why IC Reactor

In the rapidly evolving landscape of Internet Computer development, choosing the right library is critical. IC Reactor was designed from the ground up with three principles: minimal footprint, type safety, and future-proof architecture.


PackageMinified + GzippedWhatโ€™s Included
@ic-reactor/core~28 KBReactor, caching, transformations, validation
@ic-reactor/react~2.6 KBReact hooks (excludes core + react)

Thatโ€™s it. ~30 KB total for a complete, production-ready data layer.

IC Reactor is designed to be lightweight with only essential peer dependencies:

@ic-reactor/react
โ”œโ”€โ”€ @icp-sdk/core (you already need this for IC development)
โ””โ”€โ”€ @tanstack/react-query (industry-standard, likely already in your app)

IC Reactorโ€™s architecture was built with modern software engineering principles:

๐Ÿงฑ Single Responsibility

Each class has one job and does it well. ClientManager handles connections. Reactor handles canister interactions. DisplayReactor handles transformations.

๐Ÿ“ฆ Composition Over Inheritance

Build complex behaviors by composing simple, focused classes. No deep inheritance hierarchies to navigate or debug.

๐Ÿ”Œ Dependency Injection

All dependencies are injected, making testing trivial and allowing for custom implementations.

๐ŸŽฏ Zero Lock-in

Use as much or as little as you want. Every component works standalone.

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ Your Application โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ React Layer (@ic-reactor/react) โ”‚
โ”‚ โ”œโ”€โ”€ createActorHooks() โ†’ useActorQuery, useActorMutation โ”‚
โ”‚ โ”œโ”€โ”€ createAuthHooks() โ†’ useAuth, useUserPrincipal โ”‚
โ”‚ โ””โ”€โ”€ Validation utilities for forms โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ Core Layer (@ic-reactor/core) โ”‚
โ”‚ โ”œโ”€โ”€ ClientManager โ†’ Agent + Auth state management โ”‚
โ”‚ โ”œโ”€โ”€ Reactor โ†’ Canister calls + TanStack caching โ”‚
โ”‚ โ””โ”€โ”€ DisplayReactor โ†’ Type transformations + validation โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ SDK Layer (@icp-sdk/core) โ”‚
โ”‚ โ””โ”€โ”€ HttpAgent, Principal, IDL, Candid โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

FeatureIC ReactorDIY (raw SDK)
Additional Bundle Size~30 KB (on top of SDK)~50+ KB of custom code
Type Safetyโœ… End-to-end from Candidโš ๏ธ Manual type assertions
Query Cachingโœ… TanStack Query built-inโŒ Build your own
Background Refetchโœ… AutomaticโŒ Build your own
Request Deduplicationโœ… AutomaticโŒ Build your own
Optimistic Updatesโœ… First-class supportโŒ Build your own
Result Unwrappingโœ… Ok/Err โ†’ try/catchโŒ Manual unwrapping
Error Typingโœ… CanisterError<E>โŒ Generic Error
Display Transformationsโœ… BigIntโ†’string, Principalโ†’textโŒ Manual conversion
Form Validationโœ… Zod schemas from CandidโŒ Build your own
Suspense Supportโœ… Built-inโŒ Complex setup
Infinite Queriesโœ… Built-inโŒ Complex setup
DevToolsโœ… TanStack Query DevToolsโŒ None
SSR Supportโœ… With prefetchingโš ๏ธ Tricky
Multi-Actorโœ… Shared ClientManagerโš ๏ธ Manual coordination

When you build your own data layer, youโ€™re signing up for:

  • Weeks of development to build caching, deduplication, and error handling
  • Ongoing maintenance as requirements change and bugs surface
  • Testing burden for edge cases you havenโ€™t thought of yet
  • Documentation debt as your team grows
  • Onboarding challenges for new developers unfamiliar with your custom setup

๐Ÿง  AI-Friendly Codebase

LLMs understand IC Reactor. Our consistent patterns, comprehensive JSDoc, and scannable structure means AI assistants can help you write code faster.

๐Ÿ“„ /llms.txt Standard

We include /llms.txt in our documentation for structured API overviews that AI models can parse effectively.

๐Ÿ”ฎ Predictable Patterns

Every hook, every class follows the same patterns. Once you learn one, you know them all โ€” and so does your AI pair programmer.

๐Ÿ“š Self-Documenting Types

TypeScript types serve as living documentation. Your IDE (and AI) can infer everything from the types alone.

// IC Reactor: AI understands this instantly โœ…
const { data, isPending, error } = useActorQuery({
functionName: "getBalance",
args: [principal],
})
// DIY approach: AI struggles with custom abstractions โŒ
const balance = useCustomHook({
actor: myActor,
method: "getBalance",
params: [principal],
cache: true,
retryOnError: 3,
transformResult: (r) => extractOk(r),
})

The first pattern is self-documenting and follows conventions that every AI model trained on TanStack Query will recognize. The second is a custom abstraction that requires context AI doesnโ€™t have.


One of IC Reactorโ€™s most elegant features:

// Your Candid method returns: variant { Ok: nat; Err: text }
const { mutate } = useActorMutation({
functionName: "transfer",
onSuccess: (balance) => {
// balance is typed as `bigint` - Err case throws automatically!
console.log(`New balance: ${balance}`);
},
onCanisterError: (error) => {
// error.err is typed as `string`
console.error(`Transfer failed: ${error.err}`);
},
});

DisplayReactor automatically converts types for UI consumption:

Candid TypeCandid ValueDisplay ValueAutomatic?
nat / int1000000000000n"1000000000000"โœ…
nat64 / int641234567890123456789n"1234567890123456789"โœ…
principalPrincipal.fromText("...")"aaaaa-aa"โœ…
opt T[value] or []value or undefinedโœ…
blob (โ‰ค96 bytes)Uint8Array"1234..."โœ…
variant { Ok; Err }{ Ok: value }{ _type: "Ok", Ok: value }โœ…

This means your React components never deal with:

  • BigInt serialization issues (JSON.stringify fails!)
  • Principal instance comparisons
  • Optional tuple unpacking (value?.[0])
  • Variant discrimination logic

Progressive Enhancement

Start simple, add complexity only when needed. Use Reactor for basic needs, upgrade to DisplayReactor for forms, add hooks as your React app grows.

Standards Over Invention

We donโ€™t reinvent the wheel. TanStack Query for caching, Zod for validation, TypeScript for types. Learn once, apply everywhere.

Explicit Over Implicit

No magic. Every transformation, every hook, every option is explicit in your code. Debugging is straightforward because the data flow is visible.

Minimal API Surface

Fewer concepts to learn means faster onboarding. We expose what you need and hide complexity behind sensible defaults.


As the creator and maintainer of IC Reactor, hereโ€™s my honest assessment:

  1. Type Safety Is Unmatched โ€” From your .did file to your React components, types flow seamlessly. This catches bugs at compile time, not runtime.

  2. The TanStack Query Foundation โ€” By building on a library with 47K+ GitHub stars and years of battle-testing, we inherit solutions to problems weโ€™d otherwise have to solve ourselves.

  3. Developer Experience โ€” The API is intuitive if you know TanStack Query. If you donโ€™t, you learn a skill that transfers to any React project.

  4. Production Ready โ€” This is v3, not v1. Weโ€™ve learned from two major versions, countless production apps, and real user feedback.

  1. Documentation โ€” Weโ€™re continuously improving docs with more examples and edge cases. Your feedback helps.

  2. Framework Support โ€” Currently React-focused. Vue, Svelte, and Solid support are on the roadmap.

  3. Offline Support โ€” TanStack Query has offline capabilities we havenโ€™t fully exposed yet.

If youโ€™re building Internet Computer applications in 2026+, there is no reason not to use IC Reactor:

  • Itโ€™s smaller than rolling your own
  • Itโ€™s faster to develop with than raw agents
  • Itโ€™s more maintainable than custom abstractions
  • Itโ€™s future-proof as the ecosystem evolves

The alternative is spending weeks building what weโ€™ve spent years perfecting.



AspectIC ReactorDIY Custom Solution
Learning Curve~1 hour if you know TanStack Query~2-4 weeks for custom solution
Additional Code~30 KB (battle-tested)~50+ KB (untested custom code)
Type SafetyFull end-to-endPartial, requires manual work
MaintenanceCommunity + maintainerYour team only
Production AppsDozensDepends on your testing
AI AssistanceExcellent (familiar patterns)Poor (custom abstractions)
Time to First FeatureDaysWeeks
Regret FactorLowHigh