Skip to content

Instantly share code, notes, and snippets.

@rmulhol
rmulhol / dispatcher.js
Created July 27, 2015 17:56
Initial version
var Dispatcher = require('flux').Dispatcher;
module.exports = new Dispatcher();
@rmulhol
rmulhol / index.html
Created July 24, 2015 14:55
Initial version
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Demo App</title>
</head>
<body>
<section id="react"></section>
<script src="js/bundle.js"></script>
</body>
@rmulhol
rmulhol / body.js
Created July 23, 2015 21:55
Edited with image toggle
var React = require('react');
var Col = require('react-bootstrap/lib/Col');
var Thumbnail = require('react-bootstrap/lib/Thumbnail');
var Button = require('react-bootstrap/lib/Button');
var Body = React.createClass({
getDefaultProps: function() {
return {
reactLogo: "http://tinyurl.com/pd5ttp3",
jsLogo: "http://tinyurl.com/olm5u5m"
@rmulhol
rmulhol / footer.js
Created July 23, 2015 21:55
Initial version
@rmulhol
rmulhol / body.js
Created July 23, 2015 21:54
Initial version
var React = require('react');
var Body = React.createClass({
render: function() {
return (
<div style={{ "textAlign": "center", "paddingTop": "70px" }}>
<h1>Welcome to the Demo React App!</h1>
<img src="http://tinyurl.com/pd5ttp3" alt="react-logo" />
</div>
);
@rmulhol
rmulhol / header.js
Created July 23, 2015 21:54
Initial version
var React = require('react');
var Navbar = require('react-bootstrap/lib/Navbar');
var Nav = require('react-bootstrap/lib/Nav');
var NavItem = require('react-bootstrap/lib/NavItem');
var Header = React.createClass({
render: function() {
return (
<Navbar fixedTop brand='Demo App'>
<Nav right>
@rmulhol
rmulhol / home_page.js
Created July 23, 2015 21:53
Initial version
var React = require('react');
var HomePage = React.createClass({
render: function() {
return (
<div>
<h1>Hello, world!</h1>
</div>
);
}
@rmulhol
rmulhol / app.js
Created July 23, 2015 21:52
Edited with HomePage component
var React = require('react');
var HomePage = require('./components/home_page');
React.render(
<HomePage />,
document.getElementById('react')
);
@rmulhol
rmulhol / app.js
Created July 23, 2015 21:51
Initial version
var React = require('react');
React.render(
<div>
<h1>Hello, world!</h1>
</div>,
document.getElementById('react')
);
@rmulhol
rmulhol / home_page.js
Created July 23, 2015 20:58
Edited with nested components
var React = require('react');
var Header = require('./header');
var Body = require('./body');
var Footer = require('./footer');
var HomePage = React.createClass({
render: function() {
return (
<div>
<Header />