mirror of
https://github.com/facebook/react.git
synced 2026-02-22 20:01:52 +00:00
Co-authored-by: Joel DSouza <joel.dsouza@kapturecrm.com> Co-authored-by: Damien Maillard <damien.maillard@dailymotion.com> Co-authored-by: Brian Vaughn <brian.david.vaughn@gmail.com>
23 lines
727 B
HTML
23 lines
727 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
|
|
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="root"></div>
|
|
<script>
|
|
const MyComponent = () => {
|
|
return React.createElement("h1", null, "Parent", React.createElement(MainIframe, null, null));
|
|
};
|
|
|
|
const MainIframe = () => {
|
|
return React.createElement("iframe", {src: "./main.html", sandbox:"allow-same-origin allow-scripts"}, null);
|
|
}
|
|
|
|
const el = () => React.createElement(MyComponent, null)
|
|
|
|
ReactDOM.render(el(), document.getElementById('root'))
|
|
</script>
|
|
</body>
|
|
</html> |