Skip to content

Commit f433574

Browse files
committed
fix(Item): interface types * 4
1 parent 71c4164 commit f433574

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/components/fields/FilterPicker/FilterPicker.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ import {
1414
useState,
1515
} from 'react';
1616
import { FocusScope, Key, useKeyboard } from 'react-aria';
17-
import { Section as BaseSection, Item, ListState } from 'react-stately';
17+
import {
18+
Section as BaseSection,
19+
ListState,
20+
Item as ReactAriaItem,
21+
} from 'react-stately';
1822

1923
import { useEvent } from '../../../_internal';
2024
import { useWarn } from '../../../_internal/hooks/use-warn';
@@ -441,7 +445,7 @@ export const FilterPicker = forwardRef(function FilterPicker<T extends object>(
441445
if (!child || typeof child !== 'object') return;
442446
const element = child as ReactElement;
443447

444-
if (element.type === Item) {
448+
if (element.type === ReactAriaItem) {
445449
const props = element.props as any;
446450
const label =
447451
props.textValue ||
@@ -523,7 +527,7 @@ export const FilterPicker = forwardRef(function FilterPicker<T extends object>(
523527
if (!child || typeof child !== 'object') return;
524528
const element = child as ReactElement;
525529

526-
if (element.type === Item) {
530+
if (element.type === ReactAriaItem) {
527531
const childKey = String(element.key);
528532
if (selectedSet.has(normalizeKeyValue(childKey))) {
529533
const props = element.props as any;
@@ -698,7 +702,7 @@ export const FilterPicker = forwardRef(function FilterPicker<T extends object>(
698702
if (sectionChild && typeof sectionChild === 'object') {
699703
const sectionElement = sectionChild as ReactElement;
700704
if (
701-
sectionElement.type === Item ||
705+
sectionElement.type === ReactAriaItem ||
702706
(sectionElement.type as any)?.displayName === 'Item'
703707
) {
704708
const clonedItem = cloneWithNormalizedKey(sectionElement);
@@ -1214,7 +1218,7 @@ export const FilterPicker = forwardRef(function FilterPicker<T extends object>(
12141218
);
12151219
}) as unknown as (<T>(
12161220
props: CubeFilterPickerProps<T> & { ref?: ForwardedRef<HTMLElement> },
1217-
) => ReactElement) & { Item: typeof Item; Section: typeof BaseSection };
1221+
) => ReactElement) & { Item: typeof ListBox.Item; Section: typeof BaseSection };
12181222

12191223
FilterPicker.Item = ListBox.Item;
12201224

0 commit comments

Comments
 (0)