Skip to content

Instantly share code, notes, and snippets.

@billymoon
Created October 6, 2016 22:22
Show Gist options
  • Save billymoon/4f1be594a4acd526155521b929caac27 to your computer and use it in GitHub Desktop.
Save billymoon/4f1be594a4acd526155521b929caac27 to your computer and use it in GitHub Desktop.
untitled
import React from 'react'
import ReactDOM from 'react-dom'
import $ from 'jquery'
var app = $('<div>').attr({id: 'app'})
$(document.body).html(app)
$(document.head).append('<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/g/bootswatch(darkly/bootstrap.min.css)">')
var Button = React.createClass({
render: function() {
return (<button className={'btn ' + 'btn-default'} onClick={this.props.click}>{this.props.children}</button>)
}
})
var Container = React.createClass({
render: function() {
return (
<div className="container" style={this.props.style}>
{this.props.children}
</div>
)
}
})
var containerStyle = {
marginTop: '2em'
}
var clicker = function(){ console.log('clicked') }
ReactDOM.render(<Container style={containerStyle}><Button click={function(){ console.log(312123) }}>Super duper</Button></Container>, app[0])
body {
margin-top: 2em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment