问题
I am working on project in reactjs, Currently I am using ant-design
form for selection of video and I implemented some logic when user click on video then display video to below but when user click on delete button and select another one the preview video is not remove with delete button . I will share my code please review it and Please help me
Thanks
Code
<PhotoText>Select a Video to Upload</PhotoText>
<FormItem>
{getFieldDecorator('video', {
rules: [
{
required: true,
message: 'Please upload video!',
},
],
})(
<Dragger onChange={this.onChange} accept="video/*">
<p className="ant-upload-drag-icon">
<Icon type="upload" />
</p>
<p className="ant-upload-text">
Click or drag Video to this area to upload
</p>
</Dragger>,
)}
{ this.state.video ? <video width="350" height="280" style={{width:'450px',marginLeft:'23px'}} src={this.state.video} controls/> : null }
</FormItem>
来源:https://stackoverflow.com/questions/53650271/how-to-remove-video-preview-when-user-click-on-delete-in-reactjs