@tamagui/core 1.108.0 → 1.108.1

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.108.0",
3
+ "version": "1.108.1",
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-use-pressable": "1.108.0",
39
- "@tamagui/react-native-use-responder-events": "1.108.0",
40
- "@tamagui/use-event": "1.108.0",
41
- "@tamagui/web": "1.108.0"
38
+ "@tamagui/react-native-use-pressable": "1.108.1",
39
+ "@tamagui/react-native-use-responder-events": "1.108.1",
40
+ "@tamagui/use-event": "1.108.1",
41
+ "@tamagui/web": "1.108.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@tamagui/build": "1.108.0",
45
- "@testing-library/react": "^14.0.0",
44
+ "@tamagui/build": "1.108.1",
45
+ "@testing-library/react": "^16.0.0",
46
46
  "csstype": "^3.0.10",
47
47
  "typescript": "^5.5.2",
48
48
  "vitest": "^0.34.3"
@@ -1,6 +1,4 @@
1
- // native only, taken from react-native
2
-
3
- import { createElement, useContext } from 'react'
1
+ import React from 'react' // native only, taken from react-native
4
2
 
5
3
  /**
6
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -120,14 +118,14 @@ export function createOptimizedView(
120
118
  }
121
119
 
122
120
  // isInText is significantly faster than just providing it each time
123
- const isInText = useContext(TextAncestor)
124
- const finalElement = createElement(ViewNativeComponent, finalProps, children)
121
+ const isInText = React.useContext(TextAncestor)
122
+ const finalElement = React.createElement(ViewNativeComponent, finalProps, children)
125
123
 
126
124
  if (!isInText) {
127
125
  return finalElement
128
126
  }
129
127
 
130
- return createElement(TextAncestor.Provider, { value: false }, finalElement)
128
+ return React.createElement(TextAncestor.Provider, { value: false }, finalElement)
131
129
  }
132
130
 
133
131
  export function getAccessibilityRoleFromRole(role) {
package/src/index.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ import React from 'react'
1
2
  import { useResponderEvents } from '@tamagui/react-native-use-responder-events'
2
3
  import type {
3
4
  StackNonStyleProps,
@@ -17,7 +18,6 @@ import {
17
18
  composeEventHandlers,
18
19
  setupHooks,
19
20
  } from '@tamagui/web'
20
- import { createElement, useMemo, useSyncExternalStore } from 'react'
21
21
 
22
22
  import { createOptimizedView } from './createOptimizedView'
23
23
  import { getBaseViews } from './getBaseViews'
@@ -107,7 +107,7 @@ setupHooks({
107
107
 
108
108
  if (willHydrate || isDOM) {
109
109
  // only necessary for DOM elements, but we need the hooks to stay around
110
- const hostRef = useMemo(
110
+ const hostRef = React.useMemo(
111
111
  () => ({
112
112
  get current() {
113
113
  return stateRef.current.host as Element
@@ -238,7 +238,7 @@ setupHooks({
238
238
  if (elementType === baseViews.Text) {
239
239
  // further optimize by not even caling elementType.render
240
240
  viewProps.children = children
241
- return createElement('RCTText', viewProps)
241
+ return React.createElement('RCTText', viewProps)
242
242
  }
243
243
  }
244
244
  },
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  /**
2
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
3
4
  *
@@ -7,9 +8,9 @@
7
8
  * @flow strict-local
8
9
  * @format
9
10
  */
10
- export declare function createOptimizedView(children: any, viewProps: Record<string, any>, baseViews: any): import("react").DetailedReactHTMLElement<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | import("react").CElement<{
11
+ export declare function createOptimizedView(children: any, viewProps: Record<string, any>, baseViews: any): React.DetailedReactHTMLElement<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> | React.CElement<{
11
12
  value: boolean;
12
- }, import("react").Component<{
13
+ }, React.Component<{
13
14
  value: boolean;
14
15
  }, any, any>>;
15
16
  export declare function getAccessibilityRoleFromRole(role: any): "none" | "alert" | "button" | "checkbox" | "combobox" | "grid" | "header" | "image" | "link" | "list" | "menu" | "menubar" | "menuitem" | "progressbar" | "radio" | "radiogroup" | "scrollbar" | "search" | "adjustable" | "spinbutton" | "summary" | "switch" | "tab" | "tablist" | "timer" | "toolbar" | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"createOptimizedView.native.d.ts","sourceRoot":"","sources":["../src/createOptimizedView.native.tsx"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,SAAS,EAAE,GAAG;;;;cAiHf;AAED,wBAAgB,4BAA4B,CAAC,IAAI,KAAA,wTAuIhD"}
1
+ {"version":3,"file":"createOptimizedView.native.d.ts","sourceRoot":"","sources":["../src/createOptimizedView.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;;;;;GAQG;AAEH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,GAAG,EACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,SAAS,EAAE,GAAG;;;;cAiHf;AAED,wBAAgB,4BAA4B,CAAC,IAAI,KAAA,wTAuIhD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,SAAS,EACV,MAAM,cAAc,CAAA;AAcrB,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAKlE,KAAK,oBAAoB,GAAG,IAAI,CAAC,WAAW,EAAE,MAAM,kBAAkB,CAAC,CAAA;AACvE,MAAM,WAAW,0BACf,SAAQ,kBAAkB,EACxB,o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