Skip to content

Commit 679a694

Browse files
chore(examples): tidy requirejs.html with prettier
1 parent c0d8217 commit 679a694

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

examples/requirejs.html

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,38 @@
11
<!DOCTYPE html>
22
<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>
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>
99

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

13-
<script>
14-
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': 'https://unpkg.com/react-dom@16/umd/react-dom.production.min'
19-
}
20-
});
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+
});
2122

22-
requirejs([
23-
'react-dom', 'html-react-parser'
24-
], function(ReactDOM, HTMLReactParser) {
25-
ReactDOM.render(
26-
HTMLReactParser(
27-
'<h2 style="font-family:\'Lucida Grande\';">' +
28-
'HTMLReactParser loaded with Require.js' +
29-
'<\/h2>'
30-
),
31-
document.getElementById('root')
32-
);
33-
});
34-
</script>
35-
</body>
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>
3638
</html>

0 commit comments

Comments
 (0)