@tamagui/use-did-finish-ssr 1.13.2 → 1.13.4
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/cjs/index.js +1 -41
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +1 -17
- package/dist/esm/index.js.map +2 -2
- package/dist/esm/index.mjs +1 -17
- package/dist/esm/index.mjs.map +2 -2
- package/package.json +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
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
|
-
var src_exports = {};
|
|
20
|
-
__export(src_exports, {
|
|
21
|
-
useDidFinishSSR: () => useDidFinishSSR
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(src_exports);
|
|
24
|
-
var import_constants = require("@tamagui/constants");
|
|
25
|
-
var import_react = require("react");
|
|
26
|
-
function useDidFinishSSR() {
|
|
27
|
-
if (import_constants.isServer || import_constants.isRSC) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
const [did, setDid] = (0, import_react.useState)(false);
|
|
31
|
-
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
32
|
-
(0, import_react.startTransition)(() => {
|
|
33
|
-
setDid(true);
|
|
34
|
-
});
|
|
35
|
-
}, []);
|
|
36
|
-
return did;
|
|
37
|
-
}
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
useDidFinishSSR
|
|
41
|
-
});
|
|
1
|
+
"use strict";var n=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var S=(e,t)=>{for(var o in t)n(e,o,{get:t[o],enumerable:!0})},c=(e,t,o,f)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of a(t))!m.call(e,i)&&i!==o&&n(e,i,{get:()=>t[i],enumerable:!(f=u(t,i))||f.enumerable});return e};var d=e=>c(n({},"__esModule",{value:!0}),e);var l={};S(l,{useDidFinishSSR:()=>p});module.exports=d(l);var r=require("@tamagui/constants"),s=require("react");function p(){if(r.isServer||r.isRSC)return!1;const[e,t]=(0,s.useState)(!1);return(0,r.useIsomorphicLayoutEffect)(()=>{(0,s.startTransition)(()=>{t(!0)})},[]),e}0&&(module.exports={useDidFinishSSR});
|
|
42
2
|
//# sourceMappingURL=index.js.map
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { isRSC, isServer, useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { startTransition, useState } from 'react'\n\nexport function useDidFinishSSR() {\n // conditional hook because it never changes if already true\n if (isServer || isRSC) {\n return false\n }\n\n const [did, setDid] = useState<boolean>(false)\n\n useIsomorphicLayoutEffect(() => {\n startTransition(() => {\n setDid(true)\n })\n }, [])\n\n return did\n}\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA2D,8BAC3DC,EAA0C,iBAEnC,SAASH,GAAkB,CAEhC,GAAI,YAAY,QACd,MAAO,GAGT,KAAM,CAACI,EAAKC,CAAM,KAAI,YAAkB,EAAK,EAE7C,sCAA0B,IAAM,IAC9B,mBAAgB,IAAM,CACpBA,EAAO,EAAI,CACb,CAAC,CACH,EAAG,CAAC,CAAC,EAEED,CACT",
|
|
6
|
+
"names": ["src_exports", "__export", "useDidFinishSSR", "__toCommonJS", "import_constants", "import_react", "did", "setDid"]
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { startTransition, useState } from "react";
|
|
3
|
-
function useDidFinishSSR() {
|
|
4
|
-
if (isServer || isRSC) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
const [did, setDid] = useState(false);
|
|
8
|
-
useIsomorphicLayoutEffect(() => {
|
|
9
|
-
startTransition(() => {
|
|
10
|
-
setDid(true);
|
|
11
|
-
});
|
|
12
|
-
}, []);
|
|
13
|
-
return did;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
useDidFinishSSR
|
|
17
|
-
};
|
|
1
|
+
import{isRSC as r,isServer as i,useIsomorphicLayoutEffect as o}from"@tamagui/constants";import{startTransition as s,useState as n}from"react";function a(){if(i||r)return!1;const[t,e]=n(!1);return o(()=>{s(()=>{e(!0)})},[]),t}export{a as useDidFinishSSR};
|
|
18
2
|
//# sourceMappingURL=index.js.map
|
package/dist/esm/index.js.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { isRSC, isServer, useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { startTransition, useState } from 'react'\n\nexport function useDidFinishSSR() {\n // conditional hook because it never changes if already true\n if (isServer || isRSC) {\n return false\n }\n\n const [did, setDid] = useState<boolean>(false)\n\n useIsomorphicLayoutEffect(() => {\n startTransition(() => {\n setDid(true)\n })\n }, [])\n\n return did\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,SAAAA,EAAO,YAAAC,EAAU,6BAAAC,MAAiC,qBAC3D,OAAS,mBAAAC,EAAiB,YAAAC,MAAgB,QAEnC,SAASC,GAAkB,CAEhC,GAAIJ,GAAYD,EACd,MAAO,GAGT,KAAM,CAACM,EAAKC,CAAM,EAAIH,EAAkB,EAAK,EAE7C,OAAAF,EAA0B,IAAM,CAC9BC,EAAgB,IAAM,CACpBI,EAAO,EAAI,CACb,CAAC,CACH,EAAG,CAAC,CAAC,EAEED,CACT",
|
|
6
|
+
"names": ["isRSC", "isServer", "useIsomorphicLayoutEffect", "startTransition", "useState", "useDidFinishSSR", "did", "setDid"]
|
|
7
7
|
}
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { startTransition, useState } from "react";
|
|
3
|
-
function useDidFinishSSR() {
|
|
4
|
-
if (isServer || isRSC) {
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
const [did, setDid] = useState(false);
|
|
8
|
-
useIsomorphicLayoutEffect(() => {
|
|
9
|
-
startTransition(() => {
|
|
10
|
-
setDid(true);
|
|
11
|
-
});
|
|
12
|
-
}, []);
|
|
13
|
-
return did;
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
useDidFinishSSR
|
|
17
|
-
};
|
|
1
|
+
import{isRSC as r,isServer as i,useIsomorphicLayoutEffect as o}from"@tamagui/constants";import{startTransition as s,useState as n}from"react";function a(){if(i||r)return!1;const[t,e]=n(!1);return o(()=>{s(()=>{e(!0)})},[]),t}export{a as useDidFinishSSR};
|
|
18
2
|
//# sourceMappingURL=index.mjs.map
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
4
|
"sourcesContent": ["import { isRSC, isServer, useIsomorphicLayoutEffect } from '@tamagui/constants'\nimport { startTransition, useState } from 'react'\n\nexport function useDidFinishSSR() {\n // conditional hook because it never changes if already true\n if (isServer || isRSC) {\n return false\n }\n\n const [did, setDid] = useState<boolean>(false)\n\n useIsomorphicLayoutEffect(() => {\n startTransition(() => {\n setDid(true)\n })\n }, [])\n\n return did\n}\n"],
|
|
5
|
-
"mappings": "AAAA,
|
|
6
|
-
"names": []
|
|
5
|
+
"mappings": "AAAA,OAAS,SAAAA,EAAO,YAAAC,EAAU,6BAAAC,MAAiC,qBAC3D,OAAS,mBAAAC,EAAiB,YAAAC,MAAgB,QAEnC,SAASC,GAAkB,CAEhC,GAAIJ,GAAYD,EACd,MAAO,GAGT,KAAM,CAACM,EAAKC,CAAM,EAAIH,EAAkB,EAAK,EAE7C,OAAAF,EAA0B,IAAM,CAC9BC,EAAgB,IAAM,CACpBI,EAAO,EAAI,CACb,CAAC,CACH,EAAG,CAAC,CAAC,EAEED,CACT",
|
|
6
|
+
"names": ["isRSC", "isServer", "useIsomorphicLayoutEffect", "startTransition", "useState", "useDidFinishSSR", "did", "setDid"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-did-finish-ssr",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.4",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@tamagui/constants": "1.13.
|
|
29
|
+
"@tamagui/constants": "1.13.4"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tamagui/build": "1.13.
|
|
32
|
+
"@tamagui/build": "1.13.4",
|
|
33
33
|
"@types/react": "^18.0.15",
|
|
34
34
|
"react": "^18.2.0",
|
|
35
35
|
"react-native": "^0.71.4"
|