Fix html-jsx compiler

It changed React Playground to add a required props but unfortunately didn't update the call sites of the front-page. I don't think it should be required so I'm just making it optional and providing the correct default value.

Test Plan:
 - Open the front page and make sure examples are working
 - Open /react/jsx-compiler.html and make sure it is working
 - Open /react/html-jsx.html and make sure it is working
This commit is contained in:
Vjeux
2013-12-23 18:32:13 +01:00
parent c7a915993e
commit 219f25c812
+9 -1
View File
@@ -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};
},