forked from gaearon/react-devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion0.11.html
More file actions
39 lines (39 loc) · 1.16 KB
/
version0.11.html
File metadata and controls
39 lines (39 loc) · 1.16 KB
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
<!doctype>
<html>
<head>
<meta charset=utf8>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.11.2/react-with-addons.js"></script>
</head>
<body>
<h1>Testing version 0.11.2</h1>
<div id="container">Will be replaced</div>
<script>
var node = document.getElementById('container');
parent.React = React;
var App = React.createClass({
displayName: 'Things are great',
getInitialState: function() {
return {awesome: true};
},
onClick: function() {
this.setState({awesome: !this.state.awesome});
},
render: function() {
return React.DOM.div({onClick: this.onClick},
'Awesome sauce',
this.state.awesome + ': awesome',
React.DOM.span(null,
'Nesting',
this.state.awesome && React.DOM.span({style: {color: 'red'}}, 'Things')),
React.createElement(Sub));
},
});
var Sub = React.createClass({
render: function() {
return React.DOM.div(null, 'Some things');
},
});
React.renderComponent(React.createElement(App), node);
</script>
</body>
</html>