mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
creatClass codemod
Reviewed By: sebmarkbage Differential Revision: D5484225 fbshipit-source-id: dc1414862e5823d1aa925f27a68f596ada627b48
This commit is contained in:
committed by
Facebook Github Bot
parent
f445ac8ef1
commit
fca30005a2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user