Skip to content

Commit f5b67bd

Browse files
authored
passing deafult type to generic (#3017)
1 parent fa40a43 commit f5b67bd

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/components/sectionsWheelPicker/index.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {useThemeProps} from '../../hooks';
66
import View from '../view';
77
import WheelPicker, {WheelPickerProps, WheelPickerItemValue} from '../WheelPicker';
88

9-
export type SectionsWheelPickerProps<T> = PropsWithChildren<{
9+
export type SectionsWheelPickerProps<T = WheelPickerItemValue> = PropsWithChildren<{
1010
/**
1111
* Array of sections.
1212
*/
@@ -45,16 +45,8 @@ export type SectionsWheelPickerProps<T> = PropsWithChildren<{
4545

4646
const SectionsWheelPicker = <T extends WheelPickerItemValue>(props: SectionsWheelPickerProps<T>) => {
4747
const themeProps = useThemeProps(props, 'SectionsWheelPicker');
48-
const {
49-
sections,
50-
itemHeight,
51-
numberOfVisibleRows,
52-
activeTextColor,
53-
inactiveTextColor,
54-
textStyle,
55-
disableRTL,
56-
testID
57-
} = themeProps;
48+
const {sections, itemHeight, numberOfVisibleRows, activeTextColor, inactiveTextColor, textStyle, disableRTL, testID} =
49+
themeProps;
5850

5951
const wheelPickerProps = {
6052
itemHeight,
@@ -90,7 +82,7 @@ const SectionsWheelPicker = <T extends WheelPickerItemValue>(props: SectionsWhee
9082

9183
SectionsWheelPicker.displayName = 'SectionsWheelPicker';
9284

93-
export default (SectionsWheelPicker);
85+
export default SectionsWheelPicker;
9486

9587
const styles = StyleSheet.create({
9688
disableRTL: {

0 commit comments

Comments
 (0)