@trpc/tanstack-react-query 0.0.0-alpha.0 → 0.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { type CreateTRPCClient } from '@trpc/client';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AnyTRPCRouter } from '@trpc/server';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { type TRPCOptionsProxy } from './createOptionsProxy';
|
|
6
|
-
export declare function createTRPCContext<TRouter extends
|
|
6
|
+
export declare function createTRPCContext<TRouter extends AnyTRPCRouter>(): {
|
|
7
7
|
TRPCProvider: (props: Readonly<{
|
|
8
8
|
children: React.ReactNode;
|
|
9
9
|
queryClient: QueryClient;
|
|
10
|
-
trpcClient: CreateTRPCClient<
|
|
10
|
+
trpcClient: CreateTRPCClient<AnyTRPCRouter>;
|
|
11
11
|
}>) => React.JSX.Element;
|
|
12
12
|
useTRPC: () => TRPCOptionsProxy<TRouter>;
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/internals/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/internals/Context.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAE9B,wBAAgB,iBAAiB,CAAC,OAAO,SAAS,aAAa;0BAMpD,QAAQ,CAAC;QACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;QAC1B,WAAW,EAAE,WAAW,CAAC;QACzB,UAAU,EAAE,gBAAgB,CAAC,aAAa,CAAC,CAAC;KAC7C,CAAC;;EA0BL"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type QueryClient } from '@tanstack/react-query';
|
|
2
2
|
import { type CreateTRPCClient } from '@trpc/client';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AnyTRPCRouter } from '@trpc/server';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import {
|
|
6
6
|
createTRPCOptionsProxy,
|
|
7
7
|
type TRPCOptionsProxy,
|
|
8
8
|
} from './createOptionsProxy';
|
|
9
9
|
|
|
10
|
-
export function createTRPCContext<TRouter extends
|
|
10
|
+
export function createTRPCContext<TRouter extends AnyTRPCRouter>() {
|
|
11
11
|
const TRPCContext = React.createContext<TRPCOptionsProxy<TRouter> | null>(
|
|
12
12
|
null,
|
|
13
13
|
);
|
|
@@ -16,7 +16,7 @@ export function createTRPCContext<TRouter extends AnyRouter>() {
|
|
|
16
16
|
props: Readonly<{
|
|
17
17
|
children: React.ReactNode;
|
|
18
18
|
queryClient: QueryClient;
|
|
19
|
-
trpcClient: CreateTRPCClient<
|
|
19
|
+
trpcClient: CreateTRPCClient<AnyTRPCRouter>;
|
|
20
20
|
}>,
|
|
21
21
|
) {
|
|
22
22
|
const value = React.useMemo(
|