diff --git a/README.md b/README.md index 71eea61caa..9bfb14a706 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ export default class MyDatePicker extends Component { You can check [index.js](https://github.com/xgfe/react-native-datepicker/blob/master/index.android.js) in the Example for detail. +> There has been changes to date component in iOS 14. To get the expected behaviour like iOS 13 and earlier, see [this](https://github.com/xgfe/react-native-datepicker/issues/425#issuecomment-691976594). + ## Properties | Prop | Default | Type | Description | diff --git a/datepicker.js b/datepicker.js index ac6cacde29..d672123215 100644 --- a/datepicker.js +++ b/datepicker.js @@ -66,7 +66,8 @@ class DatePicker extends Component { this.state.animatedHeight, { toValue: height, - duration: duration + duration: duration, + useNativeDriver: false } ).start(); } else { @@ -74,7 +75,8 @@ class DatePicker extends Component { this.state.animatedHeight, { toValue: 0, - duration: duration + duration: duration, + useNativeDriver: false } ).start(() => { this.setState({modalVisible: visible}); diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000000..7709d32279 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,34 @@ +import * as React from 'react'; + +interface DatePickerProps { + date?: Date; + style?: Object; + mode?: "date" | "datetime" | "time"; + androidMode?: "default" | "calendar" | "spinner"; + format?: string; + confirmBtnText?: string; + cancelBtnText?: string; + iconSource?: any; + minDate?: Date; + maxDate?: Date; + duration?: number; + customStyles?: Object; + showIcon?: boolean; + hideText?: boolean; + iconComponent?: Element; + disabled?: boolean; + is24Hour?: boolean; + allowFontScaling?: boolean; + placeholder?: string; + onDateChange?: Function; + onOpenModal?: Function; + onCloseModal?: Function; + onPressMask?: Function; + modalOnResponderTerminationRequest?: Function; + TouchableComponent?: any; + getDataStr?: Function; +} + +export default class DatePicker extends React.Component{ + +} diff --git a/package.json b/package.json index 61c053779c..ebf60eabb5 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.7.2", "description": "React Native DatePicker component for both Android and iOS, useing DatePickerAndroid, TimePickerAndroid and DatePickerIOS", "main": "datepicker.js", + "types": "index.d.ts", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest --coverage",