title: how to use iframe in react.js
body: <p>how can i require html from public/ with iframe?</p>
  <p>my code like this:</p>
  <h3>　App.js</h3>
  <pre><code>import React, {Component} from 'react';
  import Iframe from './IframeComm';
  
  class App extends Component {
      render() {
          return (
              &lt;div className=&quot;App&quot;&gt;
                  &lt;h1&gt;react&lt;/h1&gt;
                  &lt;Iframe
                      attributes={
                          {
                              src: '/test/test.html',
                              style: {
                                  border: '10px solid red'
                              },
                          }
                      }
                  /&gt;
              &lt;/div&gt;
          );
      }
  }
  
  export default App;
  </code></pre>
  <h3>test.html</h3>
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;meta name=&quot;viewport&quot;
        content=&quot;width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0&quot;&gt;
      &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;ie=edge&quot;&gt;
      &lt;title&gt;Document&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      iframe
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>when i use<code>npm start</code>,everything allright</p>
  <p><a href="https://i.stack.imgur.com/epcWh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/epcWh.png" alt="enter image description here" /></a></p>
  <p>but when i use <code>npm run build</code></p>
  <p><a href="https://i.stack.imgur.com/yPIfS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/yPIfS.png" alt="enter image description here" /></a></p>
  <p>toc:</p>
  <p><a href="https://i.stack.imgur.com/56ycZ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/56ycZ.png" alt="enter image description here" /></a></p>
  <p>how can i fixed this?thanks.</p>