Skip to content

Commit ea2bff6

Browse files
chore(examples): tidy and simplify requirejs.html
Remove HTML cruft and use development versions of React and ReactDOM.
1 parent 45d77ed commit ea2bff6

File tree

1 file changed

+25
-35
lines changed

1 file changed

+25
-35
lines changed

examples/requirejs.html

Lines changed: 25 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,28 @@
1-
<!DOCTYPE html>
2-
<html>
3-
<head>
4-
<meta charset="utf-8" />
5-
<title>Load with Require.js (AMD)</title>
6-
</head>
7-
<body style="padding: 50px">
8-
<div id="root"></div>
1+
<div id="root" style="padding: 50px;"></div>
92

10-
<!-- Require.js -->
11-
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.5/require.min.js"></script>
3+
<!-- RequireJS -->
4+
<script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js"></script>
125

13-
<script>
14-
window.requirejs.config({
15-
paths: {
16-
'html-react-parser': '../dist/html-react-parser.min',
17-
react: 'https://unpkg.com/react@16/umd/react.production.min',
18-
'react-dom':
19-
'https://unpkg.com/react-dom@16/umd/react-dom.production.min'
20-
}
21-
});
6+
<script>
7+
window.requirejs.config({
8+
paths: {
9+
'html-react-parser': '../dist/html-react-parser.min',
10+
react: 'https://unpkg.com/react@16/umd/react.development',
11+
'react-dom': 'https://unpkg.com/react-dom@16/umd/react-dom.development'
12+
}
13+
});
2214

23-
window.requirejs(['react-dom', 'html-react-parser'], function(
24-
ReactDOM,
25-
HTMLReactParser
26-
) {
27-
ReactDOM.render(
28-
HTMLReactParser(
29-
'<h2 style="font-family:\'Lucida Grande\';">' +
30-
'HTMLReactParser loaded with Require.js' +
31-
'<\/h2>'
32-
),
33-
document.getElementById('root')
34-
);
35-
});
36-
</script>
37-
</body>
38-
</html>
15+
window.requirejs(['html-react-parser', 'react-dom'], function(
16+
HTMLReactParser,
17+
ReactDOM
18+
) {
19+
ReactDOM.render(
20+
HTMLReactParser(
21+
'<h2 style="font-family:\'Lucida Grande\';">' +
22+
'HTMLReactParser loaded with RequireJS' +
23+
'<\/h2>'
24+
),
25+
document.getElementById('root')
26+
);
27+
});
28+
</script>

0 commit comments

Comments
 (0)