per il momento ho trovato questa soluzione:
codice:
async caricato() {
await axios.get(AUTHORS_ALL)
.then(res => {
this.setState({
authors: res.data.authors
});
}).then(function () {
});
await axios.get(EDITORS_ALL)
.then(res => {
this.setState({
editors: res.data.editors
});
});
await this.setState({
cTitolo: this.props.currentBook.title,
cPrezzo: this.props.currentBook.price,
cIsbn: this.props.currentBook.isbn,
cNote: this.props.currentBook.note,
selectedAu: this.props.currentBook.author_id,
selectedEd: this.props.currentBook.editor_id
});
document.getElementById("add_au").value = this.state.selectedAu;
document.getElementById("add_ed").value = this.state.selectedEd;
}
probabilmente non è la migliore in ambito react, ma funziona.
si accettano suggerimenti ovviamente!