@tamagui/core 1.123.0 → 1.123.2

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/core",
3
- "version": "1.123.0",
3
+ "version": "1.123.2",
4
4
  "source": "src/index.tsx",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -35,14 +35,14 @@
35
35
  "native-test.d.ts"
36
36
  ],
37
37
  "dependencies": {
38
- "@tamagui/react-native-media-driver": "1.123.0",
39
- "@tamagui/react-native-use-pressable": "1.123.0",
40
- "@tamagui/react-native-use-responder-events": "1.123.0",
41
- "@tamagui/use-event": "1.123.0",
42
- "@tamagui/web": "1.123.0"
38
+ "@tamagui/react-native-media-driver": "1.123.2",
39
+ "@tamagui/react-native-use-pressable": "1.123.2",
40
+ "@tamagui/react-native-use-responder-events": "1.123.2",
41
+ "@tamagui/use-event": "1.123.2",
42
+ "@tamagui/web": "1.123.2"
43
43
  },
44
44
  "devDependencies": {
45
- "@tamagui/build": "1.123.0",
45
+ "@tamagui/build": "1.123.2",
46
46
  "@testing-library/react": "^16.1.0",
47
47
  "csstype": "^3.0.10",
48
48
  "typescript": "^5.7.2",
@@ -1,15 +1,38 @@
1
1
  import { validStyles, stylePropsAll } from '@tamagui/helpers'
2
2
 
3
- // this does exist :/
4
- import ReactNativeVersion from 'react-native/Libraries/Core/ReactNativeVersion'
3
+ function getReactNativeVersion() {
4
+ let version = process.env.REACT_NATIVE_VERSION || ''
5
+
6
+ if (!process.env.REACT_NATIVE_VERSION) {
7
+ try {
8
+ const ReactNativeOfficalVersion =
9
+ require('react-native/Libraries/Core/ReactNativeVersion') as
10
+ | { version: { major: number; minor: number; patch: number } }
11
+ | undefined
12
+
13
+ if (ReactNativeOfficalVersion) {
14
+ const {
15
+ version: { major, minor, patch },
16
+ } = ReactNativeOfficalVersion
17
+ version = `${major}.${minor}.${patch}`
18
+ }
19
+ } catch {
20
+ // can't win them all
21
+ } finally {
22
+ if (!version) {
23
+ version = '0.77'
24
+ }
25
+ }
26
+ }
27
+
28
+ const [major, minor, patch] = version.split('.')
29
+ return [+major, +minor, +patch] as const
30
+ }
5
31
 
6
32
  // mutate valid style props based on react native version
7
33
 
8
34
  export function addNativeValidStyles() {
9
- if (!ReactNativeVersion) return
10
- const {
11
- version: { major, minor },
12
- } = ReactNativeVersion as { version: { major: number; minor: number; patch: number } }
35
+ const [major, minor] = getReactNativeVersion()
13
36
 
14
37
  if (major === 0 && minor >= 77) {
15
38
  const additional = {
@@ -1 +1 @@
1
- {"version":3,"file":"addNativeValidStyles.native.d.ts","sourceRoot":"","sources":["../src/addNativeValidStyles.native.ts"],"names":[],"mappings":"AAOA,wBAAgB,oBAAoB,SAmBnC"}
1
+ {"version":3,"file":"addNativeValidStyles.native.d.ts","sourceRoot":"","sources":["../src/addNativeValidStyles.native.ts"],"names":[],"mappings":"AAiCA,wBAAgB,oBAAoB,SAgBnC"}