Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/@react-aria/collections/src/CollectionBuilder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const CollectionContext = createContext<CachedChildrenOptions<unknown> | null>(n
export function Collection<T extends object>(props: CollectionProps<T>): JSX.Element {
let ctx = useContext(CollectionContext)!;
let dependencies = (ctx?.dependencies || []).concat(props.dependencies);
let idScope = props.idScope || ctx?.idScope;
let idScope = props.idScope ?? ctx?.idScope;
let children = useCollectionChildren({
...props,
idScope,
Expand Down
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 @@ -50,7 +50,7 @@ export function useCachedChildren<T extends object>(props: CachedChildrenOptions
throw new Error('Could not determine key for item');
}

if (idScope) {
if (idScope != null) {
key = idScope + ':' + key;
}
// Note: only works if wrapped Item passes through id...
Expand Down
10 changes: 5 additions & 5 deletions packages/react-aria-components/stories/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,10 +212,10 @@ let columns = [
];

let rows = [
{id: 1, name: 'Games', date: '6/7/2020', type: 'File folder'},
{id: 2, name: 'Program Files', date: '4/7/2021', type: 'File folder'},
{id: 3, name: 'bootmgr', date: '11/20/2010', type: 'System file'},
{id: 4, name: 'log.txt', date: '1/18/20167', type: 'Text Document'}
{id: 0, name: 'Games', date: '6/7/2020', type: 'File folder'},
{id: 1, name: 'Program Files', date: '4/7/2021', type: 'File folder'},
{id: 2, name: 'bootmgr', date: '11/20/2010', type: 'System file'},
{id: 3, name: 'log.txt', date: '1/18/20167', type: 'Text Document'}
];

export const TableDynamicExample: TableStory = () => {
Expand All @@ -228,7 +228,7 @@ export const TableDynamicExample: TableStory = () => {
</TableHeader>
<TableBody items={rows}>
{(item) => (
<Row columns={columns}>
<Row columns={columns} id={item.id}>
{(column) => {
return <Cell>{item[column.id]}</Cell>;
}}
Expand Down