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
Vjeux committed
Dec 23, 2013 at 18:24 UTC
6bd9f35bf3bb353a0542d33fafa9405f0a0e9843
1 file changed
+9
-1
docs/_js/live_editor.js
+9
-1
@@ -57,10 +57,18 @@ var ReactPlayground = React.createClass({
57
58
propTypes: {
59
codeText: React.PropTypes.string.isRequired,
60
- transformer: React.PropTypes.func.isRequired,
60
+ transformer: React.PropTypes.func,
61
renderCode: React.PropTypes.bool,
62
},
63
64
+ getDefaultProps: function() {
65
+ return {
66
+ transformer: function(code) {
67
+ return JSXTransformer.transform(code).code;
68
+ }
69
+ };
70
+ },
71
+
72
getInitialState: function() {
73
return {mode: this.MODES.XJS, code: this.props.codeText};
74
},