ReactRPC is a full-feature integration library for gRPC-Web into React applications, currently at version 1.0.5 (2023). It provides a set of React hooks and components that simplify connecting to gRPC services from a React frontend, handling bidirectional streaming, and managing state with built-in support for Redux. Unlike manual gRPC-Web client setup, it offers a declarative approach with auto-generated hooks based on protobuf definitions. The library targets developers building real-time applications with gRPC-Web and React, and its release cadence is mature but infrequent.
npm install reactrpcNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Sets up a gRPC-Web client with a React provider, then calls a unary RPC method using the useGrpcUnary hook, showing loading and error states.
Ensure the same protobuf schema file is used on both client and server, and that protobufjs version is compatible.
Always use the createGrpcClient function provided by reactrpc to instantiate the client, and pass it to GrpcProvider.
Consider alternatives like @improbable-eng/grpc-web or direct grpc-web integration if you need active maintenance or newer React compatibility.
Use ES module imports (import) instead of require(). If using Node.js, ensure your project is configured for ESM.
Ensure you provide an object with at least 'protoPath' (or 'protoLoader') and 'serviceName' to createGrpcClient.
Run 'npm install grpc-web' and ensure it is imported before using reactrpc (e.g., import 'grpc-web' at entry point).
Install and configure buffer package (npm install buffer) and add to webpack/rollup config or polyfill in browser.