Skip to content

Commit 742d5f2

Browse files
committed
allowing only expected types as ListItem
1 parent 432a450 commit 742d5f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/SelectionList/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import type {JSXElementConstructor, ReactElement, ReactNode} from 'react';
22
import type {GestureResponderEvent, InputModeOptions, LayoutChangeEvent, SectionListData, StyleProp, TextStyle, ViewStyle} from 'react-native';
33
import type {Errors, Icon, PendingAction} from '@src/types/onyx/OnyxCommon';
44
import type ChildrenProps from '@src/types/utils/ChildrenProps';
5+
import RadioListItem from "@components/SelectionList/RadioListItem";
6+
import UserListItem from "@components/SelectionList/UserListItem";
57

68
type CommonListItemProps<TItem> = {
79
/** Whether this item is focused (for arrow key controls) */
@@ -114,7 +116,7 @@ type BaseSelectionListProps<TItem extends ListItem> = Partial<ChildrenProps> & {
114116
sections: Array<SectionListData<TItem, Section<TItem>>>;
115117

116118
/** Default renderer for every item in the list */
117-
ListItem: JSXElementConstructor<BaseListItemProps<ListItem>>;
119+
ListItem: typeof RadioListItem | typeof UserListItem;
118120

119121
/** Whether this is a multi-select list */
120122
canSelectMultiple?: boolean;

0 commit comments

Comments
 (0)