@sylphx/lens-react 2.2.0 → 2.3.0
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/package.json +3 -2
- package/src/context.tsx +4 -1
- package/src/create.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sylphx/lens-react",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "React bindings for Lens API framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"author": "SylphxAI",
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@sylphx/lens-client": "^2.
|
|
33
|
+
"@sylphx/lens-client": "^2.2.0",
|
|
34
|
+
"@sylphx/lens-core": "^2.1.0"
|
|
34
35
|
},
|
|
35
36
|
"peerDependencies": {
|
|
36
37
|
"react": ">=18.0.0"
|
package/src/context.tsx
CHANGED
|
@@ -27,7 +27,10 @@ const LENS_CONTEXT_KEY = Symbol.for("@sylphx/lens-react/context");
|
|
|
27
27
|
* (common in monorepos), all instances share the same React context.
|
|
28
28
|
*/
|
|
29
29
|
function getOrCreateContext(): React.Context<LensClient<any, any> | null> {
|
|
30
|
-
const globalObj = globalThis as unknown as Record<
|
|
30
|
+
const globalObj = globalThis as unknown as Record<
|
|
31
|
+
symbol,
|
|
32
|
+
React.Context<LensClient<any, any> | null>
|
|
33
|
+
>;
|
|
31
34
|
|
|
32
35
|
if (!globalObj[LENS_CONTEXT_KEY]) {
|
|
33
36
|
globalObj[LENS_CONTEXT_KEY] = createContext<LensClient<any, any> | null>(null);
|
package/src/create.tsx
CHANGED
|
@@ -292,8 +292,8 @@ function createQueryHook<TInput, TOutput>(
|
|
|
292
292
|
};
|
|
293
293
|
|
|
294
294
|
// Create the endpoint object with hook + fetch
|
|
295
|
-
const endpoint = useQueryHook as QueryEndpoint<TInput, TOutput>;
|
|
296
|
-
endpoint.fetch = fetch;
|
|
295
|
+
const endpoint = useQueryHook as unknown as QueryEndpoint<TInput, TOutput>;
|
|
296
|
+
endpoint.fetch = fetch as QueryEndpoint<TInput, TOutput>["fetch"];
|
|
297
297
|
|
|
298
298
|
cachedHook = endpoint;
|
|
299
299
|
return cachedHook;
|