newState.value 可能没值

This commit is contained in:
liaoxuezhi 2022-03-24 22:35:24 +08:00
parent 8c99dd1820
commit 358b7d429d

View File

@ -371,7 +371,8 @@ export class DatePicker extends React.Component<DateProps, DatePickerState> {
value: normalizeValue(props.value, props.format)
};
newState.inputValue = newState.value.format(this.props.inputFormat) || '';
newState.inputValue =
newState.value?.format(this.props.inputFormat) || '';
this.setState(newState);
}