From fdbcf01af150967dd813029fc38a6d8390d57633 Mon Sep 17 00:00:00 2001 From: Xiaoyan Li Date: Tue, 21 Apr 2026 19:50:55 +0800 Subject: [PATCH] fix: re-export RenderProps-related types from react-aria-components to fix downstream TS2742 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v1.17.0 types refactor split the bundled types.d.ts into per-source files. RenderProps extends StyleRenderProps extends DOMRenderProps, and StyleRenderProps['style'] uses StyleOrFunction — neither was publicly nameable. Downstream packages built with composite/declaration emit then fail with TS2742 on any inferred type whose expansion crosses these names. Adds `export` to StyleOrFunction and re-exports DOMRenderProps, PossibleLinkDOMRenderProps, DOMRenderFunction, ClassNameOrFunction, StyleOrFunction, and ChildrenOrFunction from the package entry. Type-only, additive — no runtime impact. Co-Authored-By: Claude Opus 4.7 (1M context) --- packages/react-aria-components/exports/index.ts | 2 +- packages/react-aria-components/src/utils.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-aria-components/exports/index.ts b/packages/react-aria-components/exports/index.ts index f474cd21b8c..5256a2a33a9 100644 --- a/packages/react-aria-components/exports/index.ts +++ b/packages/react-aria-components/exports/index.ts @@ -161,7 +161,7 @@ export type {TooltipProps, TooltipRenderProps, TooltipTriggerComponentProps} fro export type {TreeProps, TreeRenderProps, TreeEmptyStateRenderProps, TreeItemProps, TreeItemRenderProps, TreeItemContentProps, TreeItemContentRenderProps, TreeLoadMoreItemProps, TreeLoadMoreItemRenderProps} from '../src/Tree'; export type {DragOptions, DragResult} from 'react-aria/useDrag'; export type {DragAndDropHooks, DragAndDropOptions, DropIndicatorProps, DropIndicatorRenderProps} from '../src/useDragAndDrop'; -export type {ContextValue, RenderProps, SlotProps, StyleRenderProps} from '../src/utils'; +export type {ContextValue, RenderProps, SlotProps, StyleRenderProps, DOMRenderProps, PossibleLinkDOMRenderProps, DOMRenderFunction, ClassNameOrFunction, StyleOrFunction, ChildrenOrFunction} from '../src/utils'; export type {VirtualizerProps} from '../src/Virtualizer'; export type {DateValue} from 'react-stately/useDateFieldState'; diff --git a/packages/react-aria-components/src/utils.tsx b/packages/react-aria-components/src/utils.tsx index 65225f8bb68..45afcb77ac7 100644 --- a/packages/react-aria-components/src/utils.tsx +++ b/packages/react-aria-components/src/utils.tsx @@ -68,7 +68,7 @@ export interface DOMProps extends StyleProps, SharedDOMProps { } export type ClassNameOrFunction = string | ((values: T & {defaultClassName: string | undefined}) => string); -type StyleOrFunction = CSSProperties | ((values: T & {defaultStyle: CSSProperties}) => CSSProperties | undefined); +export type StyleOrFunction = CSSProperties | ((values: T & {defaultStyle: CSSProperties}) => CSSProperties | undefined); export interface StyleRenderProps extends DOMRenderProps { /** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. */