-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathindex.html
42 lines (35 loc) · 991 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>JSX Parser</title>
<script src="https://cdn.bootcss.com/react/15.5.4/react.js"></script>
<script src="https://cdn.bootcss.com/react/15.5.4/react-dom.js"></script>
<script src='./index.umd.js'>
jsx - parser
</script>
<script src='./evalJSX.js'></script>
<script>
evalJSX.globalNs = 'React'
class A extends React.Component {
constructor(props) {
super(props)
this.state = {
aaa: 111
}
}
render() {
return evalJSX(`<div className={"hello"}>{this.state.aaa}</div>`, {
this: this
})
}
}
window.onload = function() {
ReactDOM.render(React.createElement(A), document.getElementById('example'))
}
</script>
</head>
<body>
<div id="example"></div>
</body>
</html>