Skip to content

Instantly share code, notes, and snippets.

@uxnjs01
uxnjs01 / list-react.js
Created August 25, 2015 13:08
Redering List in React
var FruitList = React.createClass({
render: function() {
var fruits = [
{
id: 1,
name: 'apples'
},
{
id: 2,
name: 'oranges'
@uxnjs01
uxnjs01 / react-classname-example.js
Created August 24, 2015 01:41
React className Example
var ExampleComponent = React.createClass({
render: function() {
var hello = "hello";
return (
<h1 className={ hello }>Hello, World!</h1>
);
}
});
@uxnjs01
uxnjs01 / interactive-component-with-state.js
Last active August 29, 2015 14:27
Interactive Component With State
var StateExample = React.createClass({
render: function() {
getInitialState: function() {
return {
likes: 3
}
},
increment: function(e) {
this.setState({ likes: this.state.likes + 1 });
},
@uxnjs01
uxnjs01 / component-with-state.js
Created August 23, 2015 00:29
Component with state
var StateExample = React.createClass({
render: function() {
getInitialState: function() {
return {
likes: 3
}
},
return (
<p>
{this.state.likes} people like this.
@uxnjs01
uxnjs01 / component-without-state.js
Last active August 29, 2015 14:27
Component Without State
var StateExample = React.createClass({
render: function() {
return (
<p>
3 people like this.
</p>
);
}
});
@uxnjs01
uxnjs01 / render-helloworld-component.html
Created August 21, 2015 02:29
Rendering HelloWorld Component
<!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>
@uxnjs01
uxnjs01 / hello-world-component-create.html
Created August 21, 2015 02:26
Creating the HelloWorld Component
<!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>
@uxnjs01
uxnjs01 / load-react-jsx-cdn.html
Last active December 11, 2016 05:28
Loading React and JSXTransformer with Facebook's CDN
<!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>