Skip to content

Instantly share code, notes, and snippets.

@m4tthumphrey
Created May 2, 2014 14:13
Show Gist options
  • Save m4tthumphrey/a0bd2e63531e847289cf to your computer and use it in GitHub Desktop.
Save m4tthumphrey/a0bd2e63531e847289cf to your computer and use it in GitHub Desktop.
var ToolboxBlock = React.createClass({
handleClick: function() {
// need to reference the div here
},
render: function() {
var type = this.props.type;
var className = 'block block-type-'+type;
var blockId = 'block-'+Math.random();
return (
<div onClick={this.handleClick} className={className} ref={blockId}>{type}</div>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment