how can i require html from public/ with iframe?
my code like this:
App.js
import React, {Component} from 'react';
import Iframe from './IframeComm';
class App extends Component {
render() {
return (
<div className="App">
<h1>react</h1>
<Iframe
attributes={
{
src: '/test/test.html',
style: {
border: '10px solid red'
},
}
}
/>
</div>
);
}
}
export default App;
test.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
iframe
</body>
</html>
when i usenpm start,everything allright
but when i use npm run build
toc:
how can i fixed this?thanks.


