@tamagui/use-window-dimensions 1.26.0 → 1.27.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/use-window-dimensions",
3
- "version": "1.26.0",
3
+ "version": "1.27.0",
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.26.0"
29
+ "@tamagui/constants": "1.27.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@tamagui/build": "1.26.0",
32
+ "@tamagui/build": "1.27.0",
33
33
  "@types/react": "^18.0.15",
34
34
  "react": "^18.2.0",
35
35
  "react-native": "^0.71.7"
@@ -1,30 +0,0 @@
1
- import { useIsomorphicLayoutEffect } from "@tamagui/constants";
2
- import { useState } from "react";
3
- import { useWindowDimensions as useWindowDimensionsRN } from "react-native";
4
- const initialValue = {
5
- fontScale: 1,
6
- height: 800,
7
- width: 600,
8
- scale: 1
9
- };
10
- function configureInitialWindowDimensions(next) {
11
- Object.assign(initialValue, next);
12
- }
13
- function useWindowDimensions({ initial } = {}) {
14
- const current = useWindowDimensionsRN();
15
- if (process.env.TAMAGUI_TARGET != "web") {
16
- return current;
17
- }
18
- const [state, setState] = useState(
19
- initial ? { ...initialValue, ...initial } : initialValue
20
- );
21
- useIsomorphicLayoutEffect(() => {
22
- setState(current);
23
- }, Object.values(current));
24
- return state;
25
- }
26
- export {
27
- configureInitialWindowDimensions,
28
- useWindowDimensions
29
- };
30
- //# sourceMappingURL=index.mjs.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,SAAS,iCAAiC;AAC1C,SAAS,gBAAgB;AACzB,SAAqB,uBAAuB,6BAA6B;AAMzE,MAAM,eAA2B;AAAA,EAC/B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,OAAO;AACT;AAEO,SAAS,iCAAiC,MAA2B;AAC1E,SAAO,OAAO,cAAc,IAAI;AAClC;AAEO,SAAS,oBAAoB,EAAE,QAAQ,IAAuC,CAAC,GAAG;AACvF,QAAM,UAAU,sBAAsB;AAEtC,MAAI,QAAQ,IAAI,kBAAkB,OAAO;AACvC,WAAO;AAAA,EACT;AAEA,QAAM,CAAC,OAAO,QAAQ,IAAI;AAAA,IACxB,UAAU,EAAE,GAAG,cAAc,GAAG,QAAQ,IAAI;AAAA,EAC9C;AAEA,4BAA0B,MAAM;AAC9B,aAAS,OAAO;AAAA,EAClB,GAAG,OAAO,OAAO,OAAO,CAAC;AAEzB,SAAO;AACT;",
5
- "names": []
6
- }