Skip to content

Commit 01d105d

Browse files
committed
Add ES5 React example for beginners (#73)
1 parent e9a7cb1 commit 01d105d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

examples/es5/es5-example.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>React ES5 Example</title>
6+
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
7+
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
8+
</head>
9+
<body>
10+
<div id="root"></div>
11+
<script>
12+
//Here ES5-style functional component
13+
function Hello(props) {
14+
return React.createElement('h1', null, 'Hello, React ES5!');
15+
}
16+
17+
ReactDOM.render(
18+
React.createElement(Hello, null, null),
19+
document.getElementById('root')
20+
);
21+
</script>
22+
</body>
23+
</html>

0 commit comments

Comments
 (0)