Hi everyone! ![]()
I’m excited to announce the v3 Beta of IC Reactor — a modern, type-safe library designed to solve the “frontend boilerplate” when building on the Internet Computer.
If you’ve ever found yourself manually managing actors queries and mutations, handling forms, writing endless if ('ok' in result) checks to unwrap Candid variants, or trying to figure out how to cache canister responses without reinventing the wheel, IC Reactor is for you.
The Concept: TanStack Query for the IC
Rather than building another meta-framework, IC Reactor is built directly on top of TanStack Query (formerly React Query). This means you get production-grade caching, background refetching, and optimistic updates out of the box, but specifically tailored for IC canisters.
Key Features in v3
Automatic Result Unwrapping (The Pain Killer): Say goodbye to manually checking OkvsErrvariants. IC Reactor automatically unwrapsResult<T, E>types. If the canister returns anErr, it’s thrown as a typedCanisterError, allowing you to use standardtry/catchor hook-level error states.
End-to-End Type Safety: Your Candid definitions flow directly into your React hooks. Complete autocomplete and type checking from .didto UI.
Auto Transformations (DisplayReactor): Automatically handles display-ready types (BigInt → string, Principal → text, etc.) so your UI logic stays clean.
Power Hooks: Intuitive useActorQuery,useActorMutation, anduseActorInfiniteQuery(perfect for paginated lists).
Seamless Auth: Built-in support for Internet Identity via createAuthHooks.
AI-Friendly: Includes a structured llms.txt and Cursor rules to help AI assistants write better code for your project.
Why use Reactor instead of a standard Actor?
| Feature | Standard Actor | IC Reactor |
|---|---|---|
| Type-safe methods | ||
| Result Unwrapping | ||
| Error Handling | ||
| Query Caching | ||
| Background Refetching | ||
| Identity Sharing |
Quick Look
// Candid: get_user_profile : (text) -> (variant { Ok : UserProfile; Err : text }) query;
// No more 'if (ok in result)' boilerplate!
const { data, error, isError } = useActorQuery({
functionName: "get_user_profile",
args: [userId],
});
if (isError) {
// error is a typed CanisterError if the canister returned an Err variant
console.error("Canister said no:", error.err);
}
Try the Demos!
We have several live examples in the repository that showcase these features in action:
ICRC Wallet: A simple example of using IC Reactor with TanStack Router.
ckBTC Wallet: A simple example of using IC Reactor with ckBTC.
Codec Demo: See how new codec works.
Multi-Canister Demo: Managing multiple actors with one identity.
We need your feedback!
We are currently in v3.0.0-beta. The core API is stable, but we want to hear from devs building real-world DApps. If you’re tired of the manual boilerplate, please give it a spin!
We want to know:
- Does the
DisplayReactorsimplify your UI code? - How is the experience of managing multiple canisters?
- What are we missing to make this your go-to library for every IC project?
Links:
Documentation (v3)
GitHub Give it a star!
npm add @ic-reactor/react@beta @icp-sdk/core @tanstack/react-query
Special thanks to the @icp-sdk team (@ilbert, @peterparker) for their tireless work on a clean, type-safe SDK that powers IC Reactor.