This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var FruitList = React.createClass({ | |
render: function() { | |
var fruits = [ | |
{ | |
id: 1, | |
name: 'apples' | |
}, | |
{ | |
id: 2, | |
name: 'oranges' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ExampleComponent = React.createClass({ | |
render: function() { | |
var hello = "hello"; | |
return ( | |
<h1 className={ hello }>Hello, World!</h1> | |
); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var StateExample = React.createClass({ | |
render: function() { | |
getInitialState: function() { | |
return { | |
likes: 3 | |
} | |
}, | |
increment: function(e) { | |
this.setState({ likes: this.state.likes + 1 }); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var StateExample = React.createClass({ | |
render: function() { | |
getInitialState: function() { | |
return { | |
likes: 3 | |
} | |
}, | |
return ( | |
<p> | |
{this.state.likes} people like this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var StateExample = React.createClass({ | |
render: function() { | |
return ( | |
<p> | |
3 people like this. | |
</p> | |
); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React.js Hello World!</title> | |
<script src="https://fb.me/react-0.13.3.js"></script> | |
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React.js Hello World!</title> | |
<script src="https://fb.me/react-0.13.3.js"></script> | |
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React.js Hello World!</title> | |
<script src="https://fb.me/react-0.13.3.js"></script> | |
<script src="https://fb.me/JSXTransformer-0.13.3.js"></script> | |
</head> | |
<body> |