score:0

let data;

(async () => {
  data = await asyncRequest();
  return data;
})();

class Test extends React.Component {
  render().then(function(res, err) {
    return <h1>Hello, {data}</h1>;
  });
}

score:0

if(isLoading) {
  return <h1>Loading...</h1>
} else {
  return <h1>Hello, {data}</h1>;
}

Related Query

More Query from same tag