Getting an error after using setState with a promise

setState doesn't return a Promise. It is most probably a void function.


setState accepts a callback, but it doesn't return a promise. See docs

Calls to setState are asynchronous - don’t rely on this.state to reflect the new value immediately after calling setState. Pass an updater function instead of an object if you need to compute values based on the current state (see below for details).

(event) => {
    this.setState({playerMarkerPositionFuture: event.nativeEvent.coordinate }, () => alert("hello"));
}

Instead of using a promise to call alert after setState is finished, use a callback instead

onDragEnd={(event) => 
this.setState({ 
    playerMarkerPositionFuture: event.nativeEvent.coordinate 
}, () => {
    alert("hello")
})}