From 70941c0354162906ce1e7cfd55734591d62a9141 Mon Sep 17 00:00:00 2001 From: Vjeux Date: Mon, 23 Dec 2013 18:24:22 +0100 Subject: [PATCH] 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 --- _js/live_editor.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/_js/live_editor.js b/_js/live_editor.js index e099ad419..964c74479 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}; },