Example code from http://simonsmith.io/writing-react-components-as-commonjs-modules/