Skip to content

Commit 8751f95

Browse files
Christiaan van Bemmelmmazzarolo
authored andcommitted
Type custom components in props as React.ComponentType / PropTypes.elementType (#314)
1 parent 41b0853 commit 8751f95

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/DateTimePickerModal.ios.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ export default class DateTimePickerModal extends React.PureComponent {
3838
static propTypes = {
3939
cancelTextIOS: PropTypes.string,
4040
confirmTextIOS: PropTypes.string,
41-
customCancelButtonIOS: PropTypes.node,
42-
customConfirmButtonIOS: PropTypes.node,
43-
customHeaderIOS: PropTypes.node,
44-
customPickerIOS: PropTypes.node,
41+
customCancelButtonIOS: PropTypes.elementType,
42+
customConfirmButtonIOS: PropTypes.elementType,
43+
customHeaderIOS: PropTypes.elementType,
44+
customPickerIOS: PropTypes.elementType,
4545
date: PropTypes.instanceOf(Date),
4646
headerTextIOS: PropTypes.string,
4747
modalStyleIOS: PropTypes.any,

typings/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ interface DateTimePickerProps {
2626
/**
2727
* A custom component for the cancel button on iOS
2828
*/
29-
customCancelButtonIOS?: JSX.Element;
29+
customCancelButtonIOS?: React.ComponentType;
3030

3131
/**
3232
* A custom component for the confirm button on iOS
3333
*/
34-
customConfirmButtonIOS?: JSX.Element;
34+
customConfirmButtonIOS?: React.ComponentType;
3535

3636
/**
3737
* A custom component for the confirm button on iOS that will be shown while user interacting with the date picker
@@ -58,12 +58,12 @@ interface DateTimePickerProps {
5858
/**
5959
* A custom component for the title container on iOS
6060
*/
61-
customHeaderIOS?: JSX.Element;
61+
customHeaderIOS?: React.ComponentType;
6262

6363
/**
6464
* A custom component that will replace the default DatePicker on iOS
6565
*/
66-
customPickerIOS?: JSX.Element;
66+
customPickerIOS?: React.ComponentType;
6767

6868
/**
6969
* The style of the container on iOS

0 commit comments

Comments
 (0)