I need to resolve the promise after setState complete but in react hooks setState (useState) does not have a callback function.
React hooks version of this code:
handleBeforeGetContent = () => {
return new Promise((resolve, reject) => {
this.setState({ key: 'updatedValue' }, () => resolve());
});
}