Can I pass an async function as a callback to an async function?
Yes, indeed you can. The special thing about async functions is that they always return Promises, so especially for functions whose return value is not important (callbacks, for example), you can safely put in an async function, and it would work as expected.
Taking this one step further, you can even have an async function as your componentDidMount
or componentWillReceiveProps
for example (but still not render
, which expects a JSX element to be returned, not a Promise).