xxxxxxxxxx
const [someState, setSomeState] = useState();
const promisedState = (newState) => new Promise((resolve) => setSomeState(newState, resolve))
const someFunc = async (value) => {
await promisedState(value)
// do some other stuff
}
// This way is not recommended though as it throws this error
// State updates from the useState() and useReducer() Hooks don't support the second callback argument