Skip to content

Instantly share code, notes, and snippets.

@andreypopp
Created November 19, 2013 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreypopp/7548254 to your computer and use it in GitHub Desktop.
Save andreypopp/7548254 to your computer and use it in GitHub Desktop.
unnamed: React component
<!doctype>
<html>
<head>
<title>Component Example</title>
<link rel="stylesheet" href="bundle.css">
<style>
body {
padding: 10px;
}
</style>
<script src="bundle.js"></script>
<script>
var React = require("react-tools/build/modules/React");
var Component = require("./index.jsx");
React.renderComponent(Component({name: "You"}), document.body);
</script>
</head>
<body>
</body>
</html>
.Component {
background: #444;
}
var React = require("react-tools/build/modules/React");
module.exports = React({
render: function() {
return (
<div className="Component">
Hello, {this.props.name}!
</div>
)
}
});
{
"name": "unnamed",
"version": "0.0.0",
"description": "React component",
"dependencies": {},
"style": "index.css",
"main": "index.jsx",
"example": "example.html",
"repository": {
"type": "git",
"url": "https://gist.github.com/7548254.git"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment