Revert "TimePicker #9792"

This reverts commit 5b37e09ea1.
This commit is contained in:
偏右 2018-08-08 14:02:23 +08:00
parent e2534681c4
commit 070e340958

View File

@ -70,13 +70,6 @@ export default class TimePicker extends React.Component<TimePickerProps, any> {
focusOnOpen: true,
};
static getDerivedStateFromProps(nextProps: TimePickerProps) {
if ('value' in nextProps) {
return { value: nextProps.value };
}
return null;
}
private timePickerRef: typeof RcTimePicker;
constructor(props: TimePickerProps) {
@ -93,6 +86,12 @@ export default class TimePicker extends React.Component<TimePickerProps, any> {
};
}
componentWillReceiveProps(nextProps: TimePickerProps) {
if ('value' in nextProps) {
this.setState({ value: nextProps.value });
}
}
handleChange = (value: moment.Moment) => {
if (!('value' in this.props)) {
this.setState({ value });