title: node.js ES6 how to pass value to html element
body: <p>I want to create qrcode with es6, I want to pass the return value of function <code>generateQR()</code> to <code>&lt;img&gt;</code> element,but I got a 404 error, how can I fix that
  here is my code:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>// index.js:
  const QRcode = require('qrcode');
   
  class index extends Component{
      generateQR = async text =&gt; {
        let qrSrc = "";
        try {
          qrSrc = await QRcode.toDataURL(text);
        } catch(err){
            console.log(err);
        }
        return qrSrc;
      }
  
      render(){ 
          return(
                  &lt;div&gt;
                  &lt;img src={this.generateQR("www.hello.world")}/&gt;
                  &lt;div/&gt;
          )
      }
  }</code></pre>
  </div>
  </div>
  </p>