Fix input defaultValue and value

This commit is contained in:
afc163 2018-12-28 17:31:17 +08:00 committed by 偏右
parent a7786267a7
commit b0df3c1225

View File

@ -78,7 +78,7 @@ class Input extends React.Component<InputProps, any> {
constructor(props: InputProps) {
super(props);
const value = props.value || props.defaultValue;
const value = typeof props.value === 'undefined' ? props.defaultValue : props.value;
this.state = {
value,
};