1.0.6 • Published 2 years ago
react-native-trpc-flipper-devtools v1.0.6
react-native-trpc-flipper-devtools
Setup
- Install the package and 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",
}),
],
});Setup Flipper
Open the
Plugins Manager>Install Pluginstab, search forflipper-plugin-react-native-trpcand install the plugin.Restart flipper.
You should now see
tRPC DevToolson the sidebar.