Skip to content

Commit 40a1ac6

Browse files
committed
refactor: remove redundant override type
1 parent 6d5fae7 commit 40a1ac6

File tree

2 files changed

+2
-19
lines changed

2 files changed

+2
-19
lines changed

packages/react/src/components/select/Select.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,15 @@ import React from 'react'
66
import { Button, ListBox, Popover, Select } from 'react-aria-components'
77

88
import type * as Polymorphic from '~/utilities/polymorphic'
9-
import type { Override } from '~/utilities/types'
109
import { useFormGroup } from '~/components/form/use-form-group.hook'
1110
import SelectValue from '~/components/select/SelectValue'
1211
import { SelectContext, useSelectValue } from '~/components/select/use-select.hook'
1312

1413
const __ELEMENT_TYPE__ = 'select'
1514

16-
type OverriddenSelectProps<TElement extends object> = Override<
17-
SelectProps<TElement>,
18-
{
19-
children?: React.ReactNode | ((item: TElement) => React.ReactNode)
20-
}
21-
>
22-
23-
type OverriddenListBoxProps<TElement extends object> = Override<
24-
ListBoxProps<TElement>,
25-
{
26-
items?: Iterable<TElement> | null
27-
}
28-
>
29-
3015
type ComponentOwnProps<TData extends object> = SelectVariantProps &
31-
OverriddenSelectProps<TData> &
32-
OverriddenListBoxProps<TData> & {
16+
Omit<SelectProps<TData>, 'children'> &
17+
Pick<ListBoxProps<TData>, 'items' | 'children'> & {
3318
placement?: 'top' | 'bottom'
3419
icon?: React.ReactNode
3520
}

packages/react/src/utilities/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ export type Component<
77
as?: React.ElementType<TProps>
88
}
99

10-
export type Override<T, R> = Omit<T, keyof R> & R
11-
1210
export type ComponentWithoutAs<TElement extends React.ElementType> = Omit<Component<TElement>, 'as'>
1311

1412
export type Selection = 'all' | Set<string | number>

0 commit comments

Comments
 (0)