@unifold/react-provider 0.1.70 → 0.1.71-beta.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.
- package/dist/index.d.mts +10 -4
- package/dist/index.d.ts +10 -4
- package/dist/index.js +0 -3
- package/dist/index.mjs +0 -3
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -9,11 +9,17 @@ interface UnifoldProviderProps {
|
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
publishableKey: string;
|
|
11
11
|
/**
|
|
12
|
-
* Bring your own TanStack QueryClient. When provided, UnifoldProvider
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Bring your own TanStack QueryClient. When provided, UnifoldProvider uses
|
|
13
|
+
* this client instance (so Unifold's queries share the host app's cache /
|
|
14
|
+
* devtools and no second client is created). When omitted, an internal
|
|
15
|
+
* QueryClient is created automatically.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
+
* Either way, UnifoldProvider ALWAYS renders its own QueryClientProvider with
|
|
18
|
+
* the resolved client. A `QueryClient` instance is not the same as a mounted
|
|
19
|
+
* `QueryClientProvider`, and Unifold UI (e.g. the deposit modal) frequently
|
|
20
|
+
* renders in a detached React root with no ancestor provider — so it must
|
|
21
|
+
* provide the client itself to avoid "No QueryClient set" crashes. Wrapping
|
|
22
|
+
* with the same instance the host already provides is a harmless no-op.
|
|
17
23
|
*/
|
|
18
24
|
queryClient?: QueryClient;
|
|
19
25
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,11 +9,17 @@ interface UnifoldProviderProps {
|
|
|
9
9
|
children: React.ReactNode;
|
|
10
10
|
publishableKey: string;
|
|
11
11
|
/**
|
|
12
|
-
* Bring your own TanStack QueryClient. When provided, UnifoldProvider
|
|
13
|
-
*
|
|
14
|
-
*
|
|
12
|
+
* Bring your own TanStack QueryClient. When provided, UnifoldProvider uses
|
|
13
|
+
* this client instance (so Unifold's queries share the host app's cache /
|
|
14
|
+
* devtools and no second client is created). When omitted, an internal
|
|
15
|
+
* QueryClient is created automatically.
|
|
15
16
|
*
|
|
16
|
-
*
|
|
17
|
+
* Either way, UnifoldProvider ALWAYS renders its own QueryClientProvider with
|
|
18
|
+
* the resolved client. A `QueryClient` instance is not the same as a mounted
|
|
19
|
+
* `QueryClientProvider`, and Unifold UI (e.g. the deposit modal) frequently
|
|
20
|
+
* renders in a detached React root with no ancestor provider — so it must
|
|
21
|
+
* provide the client itself to avoid "No QueryClient set" crashes. Wrapping
|
|
22
|
+
* with the same instance the host already provides is a harmless no-op.
|
|
17
23
|
*/
|
|
18
24
|
queryClient?: QueryClient;
|
|
19
25
|
}
|
package/dist/index.js
CHANGED
|
@@ -70,9 +70,6 @@ function UnifoldProvider({
|
|
|
70
70
|
[publishableKey]
|
|
71
71
|
);
|
|
72
72
|
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(UnifoldContext.Provider, { value: contextValue, children });
|
|
73
|
-
if (externalQueryClient) {
|
|
74
|
-
return content;
|
|
75
|
-
}
|
|
76
73
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_query.QueryClientProvider, { client: queryClient, children: content });
|
|
77
74
|
}
|
|
78
75
|
function useUnifold() {
|
package/dist/index.mjs
CHANGED
|
@@ -43,9 +43,6 @@ function UnifoldProvider({
|
|
|
43
43
|
[publishableKey]
|
|
44
44
|
);
|
|
45
45
|
const content = /* @__PURE__ */ jsx(UnifoldContext.Provider, { value: contextValue, children });
|
|
46
|
-
if (externalQueryClient) {
|
|
47
|
-
return content;
|
|
48
|
-
}
|
|
49
46
|
return /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: content });
|
|
50
47
|
}
|
|
51
48
|
function useUnifold() {
|
package/package.json
CHANGED