loadDetail() {
var defer = $.Deferred()
this.setState({bla-bla}, (event) => {
this.ajaxGetDetail(this.state.openedBidId).then( (json) => {
this.setState({
bla-bla
}, () => {
if (this.transmissionCollection.length === 0) {
this.ajaxRequestTransmission().then( (result) => {
result.map( (item)=>{
let obj = {}
obj[`${item.id}`] = item.name
this.transmissionCollection.push( obj )
})
let transmission_value = blabla
this.setState({ blabla1 }, () => {
return defer.promise();
})
})
} else {
let transmission_value = blabla
this.setState({ blabla2 }, () => {
return defer.promise();
})
}
})
});
});
}
this.loadDetail().then (() => {
console.log('bla')
})
не пойму почему ругается на самый последний then: Cannot read property 'then' of undefined