diff --git a/_js/live_editor.js b/_js/live_editor.js index e099ad41..964c7447 100644 --- a/_js/live_editor.js +++ b/_js/live_editor.js @@ -57,10 +57,18 @@ var ReactPlayground = React.createClass({ propTypes: { codeText: React.PropTypes.string.isRequired, - transformer: React.PropTypes.func.isRequired, + transformer: React.PropTypes.func, renderCode: React.PropTypes.bool, }, + getDefaultProps: function() { + return { + transformer: function(code) { + return JSXTransformer.transform(code).code; + } + }; + }, + getInitialState: function() { return {mode: this.MODES.XJS, code: this.props.codeText}; },