Skip to content

Commit abb466d

Browse files
chore(examples): simplify and tidy script-tag.html
Remove HTML cruft and use development versions of React and ReactDOM.
1 parent 52b3499 commit abb466d

File tree

1 file changed

+23
-28
lines changed

1 file changed

+23
-28
lines changed

examples/script-tag.html

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,27 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<meta charset="utf-8" />
5-
<title>Load with Script Tag</title>
6-
</head>
7-
<body style="padding: 50px;">
8-
<div id="root"></div>
1+
<div id="root" style="padding: 50px;"></div>
92

10-
<!-- React -->
11-
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
12-
<!-- <script src="https://unpkg.com/react@15/dist/react.min.js"></script> -->
3+
<!-- React -->
4+
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
5+
<!--
6+
<script src="https://unpkg.com/react@15/dist/react.js"></script>
7+
-->
138

14-
<!-- HTMLReactParser -->
15-
<script src="../dist/html-react-parser.min.js"></script>
9+
<!-- HTMLReactParser -->
10+
<script src="../dist/html-react-parser.min.js"></script>
1611

17-
<!-- ReactDOM -->
18-
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
19-
<!-- <script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js"></script> -->
12+
<!-- ReactDOM -->
13+
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
14+
<!--
15+
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>
16+
-->
2017

21-
<script>
22-
ReactDOM.render(
23-
HTMLReactParser(
24-
'<h2 style="font-family: \'Lucida Grande\', sans-serif;">' +
25-
'HTMLReactParser loaded with script tag' +
26-
'<\/h2>'
27-
),
28-
document.getElementById('root')
29-
);
30-
</script>
31-
</body>
32-
</html>
18+
<script>
19+
window.ReactDOM.render(
20+
window.HTMLReactParser(
21+
'<h2 style="font-family: \'Lucida Grande\', sans-serif;">' +
22+
'HTMLReactParser loaded with script tag' +
23+
'<\/h2>'
24+
),
25+
document.getElementById('root')
26+
);
27+
</script>

0 commit comments

Comments
 (0)