Skip to content

Commit 0a3204c

Browse files
authored
Chore: correct Table/Collection array types. Fixes #7656 (#7741)
1 parent 801ef48 commit 0a3204c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

packages/@react-aria/collections/src/useCachedChildren.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface CachedChildrenOptions<T> {
1919
/** The contents of the collection. */
2020
children?: ReactNode | ((item: T) => ReactNode),
2121
/** Values that should invalidate the item cache when using dynamic collections. */
22-
dependencies?: any[],
22+
dependencies?: ReadonlyArray<any>,
2323
/** A scope to prepend to all child item ids to ensure they are unique. */
2424
idScope?: Key,
2525
/** Whether to add `id` and `value` props to all child items. */

packages/react-aria-components/src/Collection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'>
1919
/** The contents of the collection. */
2020
children?: ReactNode | ((item: T) => ReactNode),
2121
/** Values that should invalidate the item cache when using dynamic collections. */
22-
dependencies?: any[]
22+
dependencies?: ReadonlyArray<any>
2323
}
2424

2525
export interface ItemRenderProps {
@@ -89,7 +89,7 @@ export interface SectionProps<T> extends Omit<SharedSectionProps<T>, 'children'
8989
/** Static child items or a function to render children. */
9090
children?: ReactNode | ((item: T) => ReactElement),
9191
/** Values that should invalidate the item cache when using dynamic collections. */
92-
dependencies?: any[]
92+
dependencies?: ReadonlyArray<any>
9393
}
9494

9595
interface SectionContextValue {

packages/react-aria-components/src/Table.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,11 @@ export interface TableHeaderRenderProps {
526526

527527
export interface TableHeaderProps<T> extends StyleRenderProps<TableHeaderRenderProps>, HoverEvents {
528528
/** A list of table columns. */
529-
columns?: T[],
529+
columns?: Iterable<T>,
530530
/** A list of `Column(s)` or a function. If the latter, a list of columns must be provided using the `columns` prop. */
531531
children?: ReactNode | ((item: T) => ReactElement),
532532
/** Values that should invalidate the column cache when using dynamic collections. */
533-
dependencies?: any[]
533+
dependencies?: ReadonlyArray<any>
534534
}
535535

536536
/**
@@ -989,7 +989,7 @@ export interface RowProps<T> extends StyleRenderProps<RowRenderProps>, LinkDOMPr
989989
/** The object value that this row represents. When using dynamic collections, this is set automatically. */
990990
value?: T,
991991
/** Values that should invalidate the cell cache when using dynamic collections. */
992-
dependencies?: any[],
992+
dependencies?: ReadonlyArray<any>,
993993
/** A string representation of the row's contents, used for features like typeahead. */
994994
textValue?: string,
995995
/** Whether the row is disabled. */

0 commit comments

Comments
 (0)