Open
Description
The answer given is:
If you want to use async/await in React, you will need Babel and transform-async-to-generator plugin. React Native ships with Babel and a set of transforms.
But, you can use it in React, like so:
function App() {
const click = async function () {
await Promise.resolve(123);
};
return (
<div onClick={click}>lorem ipsum</div>
);
}
What am I missing?
Metadata
Metadata
Assignees
Labels
No labels