From a5efd5d028ad803a18e42d245119436fb2c4d4aa Mon Sep 17 00:00:00 2001 From: yiminghe Date: Sat, 2 Jan 2016 17:03:56 +0800 Subject: [PATCH] fix range picker --- components/date-picker/RangePicker.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/date-picker/RangePicker.jsx b/components/date-picker/RangePicker.jsx index 1eb04fc764..bdbe328079 100644 --- a/components/date-picker/RangePicker.jsx +++ b/components/date-picker/RangePicker.jsx @@ -38,8 +38,9 @@ export default React.createClass({ mixins: [ PickerMixin ], componentWillReceiveProps(nextProps) { if ('value' in nextProps) { - const start = this.parseDateFromValue(nextProps.value[0]); - const end = this.parseDateFromValue(nextProps.value[1]); + const value = nextProps.value || []; + const start = this.parseDateFromValue(value[0]); + const end = this.parseDateFromValue(value[1]); this.setState({ value: [start, end] });