I received an error when trying to SetState using a Promise as a callback in React. This is likely due to an error on my part and would like some clarification on set State in React. The error message I am receiving is as follows.
ERR: "Invalid argument passed as callback. Expected a function. Instead received: [object Promise]"
I have refactored my code example below (edit) to try and provide use to others.
this.setState({ value: v }, this.callAsync)
// Async function
callAsync = async () => {
await this.props.foo({
// Something async-y
})
.then(success => console.log(success)
}