@trpc/next 10.0.0-alpha.28 → 10.0.0-alpha.30
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.
- package/dist/index.js +3 -1
- package/dist/index.mjs +4 -2
- package/dist/setupNext.d.ts +495 -42
- package/dist/setupNext.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/setupNext.tsx +4 -2
package/dist/index.js
CHANGED
|
@@ -239,11 +239,13 @@ function withTRPC(opts) {
|
|
|
239
239
|
}
|
|
240
240
|
|
|
241
241
|
function setupTRPC(opts) {
|
|
242
|
-
var hooks = react.createReactQueryHooks();
|
|
242
|
+
var hooks = react.createReactQueryHooks();
|
|
243
|
+
var proxy = react.createReactQueryProxy(); // TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
243
244
|
|
|
244
245
|
var _withTRPC = withTRPC(opts);
|
|
245
246
|
|
|
246
247
|
return {
|
|
248
|
+
proxy: proxy,
|
|
247
249
|
useContext: hooks.useContext,
|
|
248
250
|
useInfiniteQuery: hooks.useInfiniteQuery,
|
|
249
251
|
useMutation: hooks.useMutation,
|
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
5
5
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
6
|
-
import { createReactQueryHooks, createTRPCClient } from '@trpc/react';
|
|
6
|
+
import { createReactQueryHooks, createTRPCClient, createReactQueryProxy } from '@trpc/react';
|
|
7
7
|
import React, { useState, createElement } from 'react';
|
|
8
8
|
import { QueryClient, QueryClientProvider, Hydrate, dehydrate } from 'react-query';
|
|
9
9
|
import ssrPrepass from 'react-ssr-prepass';
|
|
@@ -225,11 +225,13 @@ function withTRPC(opts) {
|
|
|
225
225
|
}
|
|
226
226
|
|
|
227
227
|
function setupTRPC(opts) {
|
|
228
|
-
var hooks = createReactQueryHooks();
|
|
228
|
+
var hooks = createReactQueryHooks();
|
|
229
|
+
var proxy = createReactQueryProxy(); // TODO: maybe set TSSRContext to `never` when using `WithTRPCNoSSROptions`
|
|
229
230
|
|
|
230
231
|
var _withTRPC = withTRPC(opts);
|
|
231
232
|
|
|
232
233
|
return {
|
|
234
|
+
proxy: proxy,
|
|
233
235
|
useContext: hooks.useContext,
|
|
234
236
|
useInfiniteQuery: hooks.useInfiniteQuery,
|
|
235
237
|
useMutation: hooks.useMutation,
|