@ovok/core 0.2.53 → 0.2.54
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/hooks/index.js +14 -0
- package/package.json +1 -1
package/dist/hooks/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
4
|
if (k2 === undefined) k2 = k;
|
|
4
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -34,6 +35,19 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
35
|
})();
|
|
35
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
37
|
exports.OvokProvider = exports.useClient = exports.useCachedBinaryUrl = exports.reactContext = exports.useSubscription = exports.useSearchResources = exports.useSearchOne = exports.useSearch = exports.useResource = exports.usePrevious = exports.useMedplumProfile = exports.useMedplumNavigate = exports.useMedplumContext = void 0;
|
|
38
|
+
/*
|
|
39
|
+
* The only React-dependent module in the package.
|
|
40
|
+
*
|
|
41
|
+
* `@medplum/react-hooks` calls `createContext` at module scope, which does not
|
|
42
|
+
* exist in React's server build — so without this directive, importing
|
|
43
|
+
* anything from the package barrel crashes a React Server Component with
|
|
44
|
+
* `createContext is not a function`, including the plain, React-free
|
|
45
|
+
* `OvokClient` that most server-side callers actually want.
|
|
46
|
+
*
|
|
47
|
+
* The directive moves this module into the client graph. A server component
|
|
48
|
+
* may then import the barrel freely; only the hooks and provider below
|
|
49
|
+
* require a client component, which is where they were always usable.
|
|
50
|
+
*/
|
|
37
51
|
const react_hooks_1 = require("@medplum/react-hooks");
|
|
38
52
|
const React = __importStar(require("react"));
|
|
39
53
|
var react_hooks_2 = require("@medplum/react-hooks");
|