How do I clear the value of the time selection component RangePicker in antd-design?

 <Form.Item label={fieldLabels.createTime}>
                                            <RangePicker
                                                ref="myTextInput"
                                                showTime={{format: "HH:mm"}}
                                                format="YYYY-MM-DD HH:mm"
                                                placeholder={["", ""]} style={{width: 210}}
                                                onChange={this.handlePickerChange}/>
</Form.Item>
Mar.23,2021

state bind value, Click to set

state = {
    value: '',
};

// 
handleClick = () => {
    this.setState({ value: null });
}


// render:
<RangePicker value={this.state.value}/>

add the value attribute to the RangePicker to become a controlled component. When emptying, set the value to null


use getFieldDecorator to wrap the RangPicker.
then use setFieldsValue to set its value to undefined


state = {

keyValue: '',

};

give him a key = {this.state.keyValue}
Click to reset this.setState ({keyValue:new Date ()}) and you can empty it, which is equivalent to rendering a new one to achieve

.

how to do this


how is it emptied

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bf17bf-312c7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bf17bf-312c7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?