A Flipper plugin to visualize tRPC procedure calls for a React Native app.
Devtools in action with the example client app
- Install dependencies:
yarn add -d react-native-apollo-devtools-client react-native-flipper
- Initialize the plugin as a tRPC client middleware:
import { createTRPCReact } from "@trpc/react-query";
import { httpBatchLink } from "@trpc/client";
import { flipperDevToolsLink } from 'react-native-trpc-flipper-devtools';
export const trpc = createTRPCReact<AppRouter>();
export const trpcClient = trpc.createClient({
links: [
flipperDevToolsLink({
enabled: __DEV__,
}),
httpBatchLink({
url: "http://localhost:3000",
}),
],
});
-
Open the
Plugins Manager
>Install Plugins
tab, search forflipper-plugin-react-native-trpc
and install the plugin. -
Restart flipper.
-
You should now see
tRPC DevTools
on the sidebar.