mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
DevTools: Improve browser extension iframe support (#19827)
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>
This commit is contained in:
co-authored by
Joel DSouza
Damien Maillard
Brian Vaughn
parent
917cb01a58
commit
ec39a5e901
@@ -0,0 +1,23 @@
|
||||
<!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>
|
||||
Reference in New Issue
Block a user