@radix-ui/react-use-is-hydrated 0.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 WorkOS
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # `react-use-is-hydrated`
2
+
3
+ ## Usage
4
+
5
+ This is an internal utility, not intended for public usage.
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Determines whether or not the component tree has been hydrated.
3
+ */
4
+ declare function useIsHydrated(): boolean;
5
+
6
+ export { useIsHydrated };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Determines whether or not the component tree has been hydrated.
3
+ */
4
+ declare function useIsHydrated(): boolean;
5
+
6
+ export { useIsHydrated };
package/dist/index.js ADDED
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ useIsHydrated: () => useIsHydrated
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/use-is-hydrated.tsx
28
+ var import_shim = require("use-sync-external-store/shim");
29
+ function useIsHydrated() {
30
+ return (0, import_shim.useSyncExternalStore)(
31
+ subscribe,
32
+ () => true,
33
+ () => false
34
+ );
35
+ }
36
+ function subscribe() {
37
+ return () => {
38
+ };
39
+ }
40
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/index.ts", "../src/use-is-hydrated.tsx"],
4
+ "sourcesContent": ["export { useIsHydrated } from './use-is-hydrated';\n", "import { useSyncExternalStore } from 'use-sync-external-store/shim';\n\n/**\n * Determines whether or not the component tree has been hydrated.\n */\nexport function useIsHydrated() {\n return useSyncExternalStore(\n subscribe,\n () => true,\n () => false\n );\n}\n\nfunction subscribe() {\n return () => {};\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAqC;AAK9B,SAAS,gBAAgB;AAC9B,aAAO;AAAA,IACL;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;AAEA,SAAS,YAAY;AACnB,SAAO,MAAM;AAAA,EAAC;AAChB;",
6
+ "names": []
7
+ }
package/dist/index.mjs ADDED
@@ -0,0 +1,17 @@
1
+ // src/use-is-hydrated.tsx
2
+ import { useSyncExternalStore } from "use-sync-external-store/shim";
3
+ function useIsHydrated() {
4
+ return useSyncExternalStore(
5
+ subscribe,
6
+ () => true,
7
+ () => false
8
+ );
9
+ }
10
+ function subscribe() {
11
+ return () => {
12
+ };
13
+ }
14
+ export {
15
+ useIsHydrated
16
+ };
17
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/use-is-hydrated.tsx"],
4
+ "sourcesContent": ["import { useSyncExternalStore } from 'use-sync-external-store/shim';\n\n/**\n * Determines whether or not the component tree has been hydrated.\n */\nexport function useIsHydrated() {\n return useSyncExternalStore(\n subscribe,\n () => true,\n () => false\n );\n}\n\nfunction subscribe() {\n return () => {};\n}\n"],
5
+ "mappings": ";AAAA,SAAS,4BAA4B;AAK9B,SAAS,gBAAgB;AAC9B,SAAO;AAAA,IACL;AAAA,IACA,MAAM;AAAA,IACN,MAAM;AAAA,EACR;AACF;AAEA,SAAS,YAAY;AACnB,SAAO,MAAM;AAAA,EAAC;AAChB;",
6
+ "names": []
7
+ }
package/package.json ADDED
@@ -0,0 +1,65 @@
1
+ {
2
+ "name": "@radix-ui/react-use-is-hydrated",
3
+ "version": "0.0.0",
4
+ "license": "MIT",
5
+ "source": "./src/index.ts",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.mjs",
8
+ "files": [
9
+ "src",
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "sideEffects": false,
14
+ "dependencies": {
15
+ "use-sync-external-store": "^1.4.0"
16
+ },
17
+ "peerDependencies": {
18
+ "@types/react": "*",
19
+ "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
20
+ },
21
+ "peerDependenciesMeta": {
22
+ "@types/react": {
23
+ "optional": true
24
+ }
25
+ },
26
+ "devDependencies": {
27
+ "@types/react": "^19.0.7",
28
+ "@types/react-dom": "^19.0.3",
29
+ "@types/use-sync-external-store": "^0.0.6",
30
+ "eslint": "^9.18.0",
31
+ "react": "^19.0.0",
32
+ "react-dom": "^19.0.0",
33
+ "typescript": "^5.7.3",
34
+ "@repo/builder": "0.0.0",
35
+ "@repo/typescript-config": "0.0.0",
36
+ "@repo/eslint-config": "0.0.0"
37
+ },
38
+ "homepage": "https://radix-ui.com/primitives",
39
+ "repository": {
40
+ "type": "git",
41
+ "url": "git+https://github.com/radix-ui/primitives.git"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/radix-ui/primitives/issues"
45
+ },
46
+ "scripts": {
47
+ "lint": "eslint --max-warnings 0 src",
48
+ "clean": "rm -rf dist",
49
+ "typecheck": "tsc --noEmit",
50
+ "build": "radix-build"
51
+ },
52
+ "types": "./dist/index.d.ts",
53
+ "exports": {
54
+ ".": {
55
+ "import": {
56
+ "types": "./dist/index.d.mts",
57
+ "default": "./dist/index.mjs"
58
+ },
59
+ "require": {
60
+ "types": "./dist/index.d.ts",
61
+ "default": "./dist/index.js"
62
+ }
63
+ }
64
+ }
65
+ }
package/src/index.ts ADDED
@@ -0,0 +1 @@
1
+ export { useIsHydrated } from './use-is-hydrated';
@@ -0,0 +1,16 @@
1
+ import { useSyncExternalStore } from 'use-sync-external-store/shim';
2
+
3
+ /**
4
+ * Determines whether or not the component tree has been hydrated.
5
+ */
6
+ export function useIsHydrated() {
7
+ return useSyncExternalStore(
8
+ subscribe,
9
+ () => true,
10
+ () => false
11
+ );
12
+ }
13
+
14
+ function subscribe() {
15
+ return () => {};
16
+ }