Skip to content

Commit

Permalink
Chore: correct Table/Collection array types. Fixes #7656 (#7741)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeapage authored Feb 7, 2025
1 parent 801ef48 commit 0a3204c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/@react-aria/collections/src/useCachedChildren.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface CachedChildrenOptions<T> {
/** The contents of the collection. */
children?: ReactNode | ((item: T) => ReactNode),
/** Values that should invalidate the item cache when using dynamic collections. */
dependencies?: any[],
dependencies?: ReadonlyArray<any>,
/** A scope to prepend to all child item ids to ensure they are unique. */
idScope?: Key,
/** Whether to add `id` and `value` props to all child items. */
Expand Down
4 changes: 2 additions & 2 deletions packages/react-aria-components/src/Collection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface CollectionProps<T> extends Omit<CollectionBase<T>, 'children'>
/** The contents of the collection. */
children?: ReactNode | ((item: T) => ReactNode),
/** Values that should invalidate the item cache when using dynamic collections. */
dependencies?: any[]
dependencies?: ReadonlyArray<any>
}

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

interface SectionContextValue {
Expand Down
6 changes: 3 additions & 3 deletions packages/react-aria-components/src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,11 @@ export interface TableHeaderRenderProps {

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

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

1 comment on commit 0a3204c

@rspbot
Copy link

@rspbot rspbot commented on 0a3204c Feb 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.