mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
parent
e2534681c4
commit
070e340958
@ -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 });
|
||||
|
Loading…
Reference in New Issue
Block a user