@tamagui/use-force-update 1.0.1-beta.190 → 1.0.1-beta.192
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 +3 -5
- package/dist/cjs/index.js.map +2 -2
- package/dist/esm/index.js +3 -5
- package/dist/esm/index.js.map +2 -2
- package/dist/jsx/index.js +3 -5
- package/dist/jsx/index.js.map +2 -2
- package/package.json +2 -2
- package/src/index.ts +3 -4
package/dist/cjs/index.js
CHANGED
|
@@ -24,12 +24,10 @@ __export(src_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(src_exports);
|
|
25
25
|
var import_react = require("react");
|
|
26
26
|
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
27
|
+
const idFn = () => {
|
|
28
|
+
};
|
|
27
29
|
function useForceUpdate() {
|
|
28
|
-
|
|
29
|
-
return () => {
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
return (0, import_react.useReducer)((x) => x + 1, 0)[1];
|
|
30
|
+
return isServerSide ? idFn : (0, import_react.useReducer)((x) => x + 1, 0)[1];
|
|
33
31
|
}
|
|
34
32
|
// Annotate the CommonJS export names for ESM import in node:
|
|
35
33
|
0 && (module.exports = {
|
package/dist/cjs/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;
|
|
4
|
+
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\nconst idFn = () => {}\n\nexport function useForceUpdate() {\n return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA2B;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAEtF,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,WAAQ,yBAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE;AAC5D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useReducer } from "react";
|
|
2
2
|
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
3
|
+
const idFn = () => {
|
|
4
|
+
};
|
|
3
5
|
function useForceUpdate() {
|
|
4
|
-
|
|
5
|
-
return () => {
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
return useReducer((x) => x + 1, 0)[1];
|
|
6
|
+
return isServerSide ? idFn : useReducer((x) => x + 1, 0)[1];
|
|
9
7
|
}
|
|
10
8
|
export {
|
|
11
9
|
isServerSide,
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\
|
|
5
|
-
"mappings": "AAAA,SAAS,kBAAkB;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;
|
|
4
|
+
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\nconst idFn = () => {}\n\nexport function useForceUpdate() {\n return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAEtF,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,OAAQ,WAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE;AAC5D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/jsx/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { useReducer } from "react";
|
|
2
2
|
const isServerSide = process.env.TAMAGUI_TARGET === "web" && typeof window === "undefined";
|
|
3
|
+
const idFn = () => {
|
|
4
|
+
};
|
|
3
5
|
function useForceUpdate() {
|
|
4
|
-
|
|
5
|
-
return () => {
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
return useReducer((x) => x + 1, 0)[1];
|
|
6
|
+
return isServerSide ? idFn : useReducer((x) => x + 1, 0)[1];
|
|
9
7
|
}
|
|
10
8
|
export {
|
|
11
9
|
isServerSide,
|
package/dist/jsx/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\
|
|
5
|
-
"mappings": "AAAA,SAAS,kBAAkB;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;
|
|
4
|
+
"sourcesContent": ["import { useReducer } from 'react'\n\nexport const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'\n\nconst idFn = () => {}\n\nexport function useForceUpdate() {\n return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAEpB,MAAM,eAAe,QAAQ,IAAI,mBAAmB,SAAS,OAAO,WAAW;AAEtF,MAAM,OAAO,MAAM;AAAC;AAEb,SAAS,iBAAiB;AAC/B,SAAO,eAAe,OAAQ,WAAW,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE;AAC5D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/use-force-update",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.192",
|
|
4
4
|
"types": "./types/index.d.ts",
|
|
5
5
|
"main": "dist/cjs",
|
|
6
6
|
"module": "dist/esm",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@tamagui/build": "^1.0.1-beta.
|
|
29
|
+
"@tamagui/build": "^1.0.1-beta.192",
|
|
30
30
|
"react": "*"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -2,9 +2,8 @@ import { useReducer } from 'react'
|
|
|
2
2
|
|
|
3
3
|
export const isServerSide = process.env.TAMAGUI_TARGET === 'web' && typeof window === 'undefined'
|
|
4
4
|
|
|
5
|
+
const idFn = () => {}
|
|
6
|
+
|
|
5
7
|
export function useForceUpdate() {
|
|
6
|
-
|
|
7
|
-
return () => {}
|
|
8
|
-
}
|
|
9
|
-
return useReducer((x) => x + 1, 0)[1] as () => void
|
|
8
|
+
return isServerSide ? idFn : (useReducer((x) => x + 1, 0)[1] as () => void)
|
|
10
9
|
}
|