mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
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:
@@ -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};
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user