Skip to content

Commit

Permalink
Merge pull request #93 from ddeanto/master
Browse files Browse the repository at this point in the history
setState when new date prop is received
  • Loading branch information
feyy authored Mar 20, 2017
2 parents 1b2aef9 + 3fa7891 commit 7d78554
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ class DatePicker extends Component {
];
}

componentWillReceiveProps(nextProps) {
if (nextProps.date !== this.props.date) {
this.setState({date: this.getDate(nextProps.date)});
}
}

setModalVisible(visible) {
const {height, duration} = this.props;

Expand Down

0 comments on commit 7d78554

Please sign in to comment.