Skip to content

Commit

Permalink
Fixed otherProps spreading
Browse files Browse the repository at this point in the history
  • Loading branch information
mmazzarolo committed Sep 16, 2016
1 parent d7a03e1 commit 009ad57
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-modal-datetime-picker",
"version": "1.0.1",
"version": "1.0.2",
"description": "A react-native datetime-picker for Android and iOS",
"main": "src/index.js",
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions src/CustomDatePickerAndroid/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@ import moment from 'moment'

export default class CustomDatePickerAndroid extends Component {
static propTypes = {
visible: PropTypes.bool,
onConfirm: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired,
date: PropTypes.instanceOf(Date),
mode: PropTypes.oneOf(['date', 'time']),
date: PropTypes.object
onCancel: PropTypes.func.isRequired,
onConfirm: PropTypes.func.isRequired,
visible: PropTypes.bool
}

static defaultProps = {
visible: false,
date: new Date(),
mode: 'date',
date: new Date()
visible: false
}

componentDidUpdate = (prevProps) => {
Expand Down
20 changes: 10 additions & 10 deletions src/CustomDatePickerIOS/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ import styles from './index.style'

export default class CustomDatePickerIOS extends Component {
static propTypes = {
visible: PropTypes.bool,
cancelTextIOS: PropTypes.string,
confirmTextIOS: PropTypes.string,
date: PropTypes.instanceOf(Date),
mode: PropTypes.oneOf(['date', 'time']),
onConfirm: PropTypes.func.isRequired,
onCancel: PropTypes.func.isRequired,
mode: PropTypes.oneOf(['date', 'time']),
date: PropTypes.object,
titleIOS: PropTypes.string,
confirmTextIOS: PropTypes.string,
cancelTextIOS: PropTypes.string
visible: PropTypes.bool
}

static defaultProps = {
visible: false,
mode: 'date',
cancelTextIOS: 'Cancel',
confirmTextIOS: 'Confirm',
date: new Date(),
mode: 'date',
titleIOS: 'Pick a date',
confirmTextIOS: 'Confirm',
cancelTextIOS: 'Cancel'
visible: false
}

state = {
Expand All @@ -34,7 +34,7 @@ export default class CustomDatePickerIOS extends Component {
_handleDateChange = (date) => this.setState({ date })

render () {
const { onCancel, visible, mode, titleIOS, confirmTextIOS, cancelTextIOS, ...otherProps } = this.props
const { onCancel, visible, mode, titleIOS, confirmTextIOS, cancelTextIOS, date, ...otherProps } = this.props
return (
<CustomModal visible={visible} contentContainerStyle={styles.contentContainer}>
<View style={styles.datepickerContainer}>
Expand Down

0 comments on commit 009ad57

Please sign in to comment.