JSFiddle - React, Tailwind, and code Playground
by evgkch
Babel + JSX
const fetchData = () => new Promise((resolve) => {
setTimeout(() => {
resolve(1)
}, 1000)
});
const test = async () => {
const result = await fetchData();
return result;
};
test().then(r => console.log(r))