Skip to content

Instantly share code, notes, and snippets.

View mtho11's full-sized avatar

Mike Thompson mtho11

  • Red Hat, Inc. (http://developers.redhat.com)
  • Klamath Falls, Oregon
View GitHub Profile
@mtho11
mtho11 / ReactBindingApproaches.js
Created March 28, 2018 20:09 — forked from coryhouse/ReactBindingApproaches.js
React Binding Approaches
// Approach 1: Use React.createClass
var HelloWorld = React.createClass({
getInitialState() {
return { message: 'Hi' };
},
logMessage() {
// this magically works because React.createClass autobinds.
console.log(this.state.message);
},