Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 7400x 9180x 9180x 9180x 9180x 9180x | import React from "react";
import { useQueryClient } from "@tanstack/react-query";
import { createTRPCClient } from "@trpc/client";
import { LinksContext } from "~app/contexts/links-context";
import { TRPCProvider as RawTRPCProvider, getLinks } from "~app/utils/trpc";
export const TRPCProvider: React.FC<React.PropsWithChildren> = ({
children,
}) => {
const linksContext = React.use(LinksContext);
const queryClient = useQueryClient();
const trpcClient = React.useMemo(
() => createTRPCClient({ links: getLinks(linksContext) }),
[linksContext],
);
return (
<RawTRPCProvider trpcClient={trpcClient} queryClient={queryClient}>
{children}
</RawTRPCProvider>
);
};
|