@tamagui/web 1.110.2 → 1.110.3

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/web",
3
- "version": "1.110.2",
3
+ "version": "1.110.3",
4
4
  "source": "src/index.ts",
5
5
  "main": "dist/cjs",
6
6
  "module": "dist/esm",
@@ -27,18 +27,18 @@
27
27
  "reset.css"
28
28
  ],
29
29
  "dependencies": {
30
- "@tamagui/compose-refs": "1.110.2",
31
- "@tamagui/constants": "1.110.2",
32
- "@tamagui/helpers": "1.110.2",
33
- "@tamagui/normalize-css-color": "1.110.2",
34
- "@tamagui/timer": "1.110.2",
35
- "@tamagui/types": "1.110.2",
36
- "@tamagui/use-did-finish-ssr": "1.110.2",
37
- "@tamagui/use-event": "1.110.2",
38
- "@tamagui/use-force-update": "1.110.2"
30
+ "@tamagui/compose-refs": "1.110.3",
31
+ "@tamagui/constants": "1.110.3",
32
+ "@tamagui/helpers": "1.110.3",
33
+ "@tamagui/normalize-css-color": "1.110.3",
34
+ "@tamagui/timer": "1.110.3",
35
+ "@tamagui/types": "1.110.3",
36
+ "@tamagui/use-did-finish-ssr": "1.110.3",
37
+ "@tamagui/use-event": "1.110.3",
38
+ "@tamagui/use-force-update": "1.110.3"
39
39
  },
40
40
  "devDependencies": {
41
- "@tamagui/build": "1.110.2",
41
+ "@tamagui/build": "1.110.3",
42
42
  "@testing-library/react": "^16.0.0",
43
43
  "csstype": "^3.0.10",
44
44
  "typescript": "^5.5.2",
@@ -477,11 +477,13 @@ export function createComponent<
477
477
  propsIn[inverseShorthands[key]] ??
478
478
  defaultProps?.[key] ??
479
479
  defaultProps?.[inverseShorthands[key]]
480
+
480
481
  // if not set, use context
481
482
  if (propVal === undefined) {
482
- if (contextValue) {
483
+ const val = contextValue?.[key]
484
+ if (val !== undefined) {
483
485
  styledContextProps ||= {}
484
- styledContextProps[key] = contextValue[key]
486
+ styledContextProps[key] = val
485
487
  }
486
488
  }
487
489
  // if set in props, update context
@@ -4,7 +4,7 @@ import { composeRefs } from '@tamagui/compose-refs'
4
4
  import { isWeb } from '@tamagui/constants'
5
5
  import { composeEventHandlers } from '@tamagui/helpers'
6
6
  import type { ReactNode } from 'react'
7
- import { Children, cloneElement, forwardRef, isValidElement, version } from 'react'
7
+ import { Children, cloneElement, forwardRef, isValidElement, version, memo } from 'react'
8
8
 
9
9
  /* -------------------------------------------------------------------------------------------------
10
10
  * Slot
@@ -16,29 +16,29 @@ interface SlotProps {
16
16
 
17
17
  const is19 = version.startsWith('19.')
18
18
 
19
- export const Slot = forwardRef<any, SlotProps>(function Slot(props, forwardedRef) {
20
- const { children, ...slotProps } = props
21
-
22
- if (isValidElement(children)) {
23
- const mergedProps = mergeSlotProps(children, slotProps)
24
- return cloneElement(
25
- children,
26
- children.type['avoidForwardRef']
27
- ? mergedProps
28
- : {
29
- ...mergedProps,
30
- ref: composeRefs(
31
- forwardedRef,
32
- is19 ? (children as any).props.ref : (children as any).ref
33
- ),
34
- }
35
- )
36
- }
37
-
38
- return Children.count(children) > 1 ? Children.only(null) : null
39
- })
19
+ export const Slot = memo(
20
+ forwardRef<any, SlotProps>(function Slot(props, forwardedRef) {
21
+ const { children, ...slotProps } = props
22
+
23
+ if (isValidElement(children)) {
24
+ const mergedProps = mergeSlotProps(children, slotProps)
25
+ return cloneElement(
26
+ children,
27
+ children.type['avoidForwardRef']
28
+ ? mergedProps
29
+ : {
30
+ ...mergedProps,
31
+ ref: composeRefs(
32
+ forwardedRef,
33
+ is19 ? (children as any).props.ref : (children as any).ref
34
+ ),
35
+ }
36
+ )
37
+ }
40
38
 
41
- Slot['displayName'] = 'Slot'
39
+ return Children.count(children) > 1 ? Children.only(null) : null
40
+ })
41
+ )
42
42
 
43
43
  /* -------------------------------------------------------------------------------------------------
44
44
  * Slottable
@@ -1 +1 @@
1
- {"version":3,"file":"createComponent.d.ts","sourceRoot":"","sources":["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C,CAAA;IAC1B,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IACzB,gBAAgB,EAAE,iBAAiB,CAAA;IACnC,KAAK,EAAE,qBAAqB,CAAA;CAC7B,4CAqCA,CAAA"}
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react';
2
2
  interface SlotProps {
3
3
  children: ReactNode;
4
4
  }
5
- export declare const Slot: import("react").ForwardRefExoticComponent<SlotProps & import("react").RefAttributes<any>>;
5
+ export declare const Slot: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<SlotProps & import("react").RefAttributes<any>>>;
6
6
  export declare const Slottable: {
7
7
  ({ children }: {
8
8
  children: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"Slot.d.ts","sourceRoot":"","sources":["../../src/views/Slot.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,UAAU,SAAS;IACjB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAID,eAAO,MAAM,IAAI,2FAoBf,CAAA;AAQF,eAAO,MAAM,SAAS;mBAAkB;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE;;CAE9D,CAAA"}
1
+ {"version":3,"file":"Slot.d.ts","sourceRoot":"","sources":["../../src/views/Slot.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAOtC,UAAU,SAAS;IACjB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAID,eAAO,MAAM,IAAI,gIAsBhB,CAAA;AAMD,eAAO,MAAM,SAAS;mBAAkB;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE;;CAE9D,CAAA"}