с помощью реагирования js Мне нужно несколько загрузок изображений в Firebase. Я пробовал использовать приведенный ниже код, который не работает для множественной загрузки.
//display multi
handleChange(event) {
const file = Array.from(event.target.files);
this.setState({ file });
}
//upload multi
fileuploadHandler = () => {
const storageRef = fire.storage().ref();
storageRef.child(`images/${this.state.file.name}`)
.putFile(this.state.file).then((snapshot) => {
});
}
render() {
return (
<div className="App">
<input id="file" type="file" onChange={this.handleChange.bind(this)} required multiple />
<button onClick={this.fileuploadHandler}>Upload!</button>
</div>
)
}