creatClass codemod

Reviewed By: sebmarkbage

Differential Revision: D5484225

fbshipit-source-id: dc1414862e5823d1aa925f27a68f596ada627b48
This commit is contained in:
Brian Vaughn
2017-07-25 10:12:58 -07:00
committed by Facebook Github Bot
parent f445ac8ef1
commit fca30005a2
33 changed files with 346 additions and 261 deletions

View File

@@ -31,8 +31,14 @@ var WEB_PLAYER_VERSION = '1.2.6';
* AppRegistry.registerComponent('MyApp', () => App);
* ```
*/
var WebPlayer = React.createClass({
parseParams: function(paramString) {
class WebPlayer extends React.Component {
constructor(props, context) {
super(props, context);
this.parseParams = this.parseParams.bind(this);
}
parseParams(paramString) {
var params = {};
if (paramString) {
@@ -44,9 +50,9 @@ var WebPlayer = React.createClass({
}
return params;
},
}
render: function() {
render() {
var hash = `#code=${encodeURIComponent(this.props.children)}`;
if (this.props.params) {
@@ -65,7 +71,7 @@ var WebPlayer = React.createClass({
/>
</div>
);
},
});
}
}
module.exports = WebPlayer;