What are the problems encountered when uploading files by React?

problems encountered while using the upload component of Element-React.

state

Upload

If you know how to solve this problem, please give me your advice.

Mar.20,2021

write the type when initializing first:

form: {
    ...
    thumbnail: ""  []  {}
    ...
}

and then just cut the value directly. (or you need to describe the problem more clearly)

this.setState({
    ...
    thumbnail: response.body.ids
    ...
)}

in addition, values that do not need to be changed do not have to be renamed with setState, for example,

this.setState({
    form: {
        typeName: this.state.form.typeName,    // 
        thumbnail: response.body.ids
        }
})
Menu