|
|
@ -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}; |
|
|
|
}, |
|
|
|