forked from FormidableLabs/react-flux-concepts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path005-state.html
41 lines (34 loc) · 900 Bytes
/
005-state.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
<!-- https://docs.google.com/drawings/d/1A54z39-AOHDAZG-FPNKpmVLZOPZa8hU9rPL-ceP2kEY/edit?usp=sharing -->
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
</style>
<script src="http://fb.me/react-0.12.2.js"></script>
<script src="http://fb.me/JSXTransformer-0.12.2.js"></script>
</head>
<body>
<!--https://medium.com/react-tutorials/react-state-14a6d4f736f5
http://facebook.github.io/react/docs/tutorial.html#reactive-state -->
<script type="text/jsx">
var Recipe = React.createClass({
getInitialState : function() {
return {
ingredient : "Eggplant"
};
},
render : function() {
return (
<div>
We need {this.state.ingredient}
</div>
)
}
});
React.renderComponent(
<Recipe />,
document.body
);
</script>
</body>
</html>