Skip to content

Commit 33e18d1

Browse files
committed
refactor: replace create-react-class with ES6 classes
1 parent d9960de commit 33e18d1

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
"connect-flash": "0.1.1",
4444
"cookie-session": "2.0.0-beta.3",
4545
"copy-to-clipboard": "3.2.0",
46-
"create-react-class": "15.7.0",
4746
"csurf": "1.11.0",
4847
"express": "4.17.1",
4948
"graphql": "14.6.0",

src/dashboard/AppData.react.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,23 @@ import AppSelector from 'dashboard/AppSelector.react';
1111
import AppsManager from 'lib/AppsManager';
1212
import history from 'dashboard/history';
1313
import ParseApp from 'lib/ParseApp';
14-
import createClass from 'create-react-class';
1514

16-
let AppData = createClass({
17-
childContextTypes: {
18-
generatePath: PropTypes.func,
19-
currentApp: PropTypes.instanceOf(ParseApp)
20-
},
15+
class AppData extends React.Component {
16+
constructor(props) {
17+
super(props);
18+
this.generatePath = this.generatePath.bind(this);
19+
}
2120

2221
getChildContext() {
2322
return {
2423
generatePath: this.generatePath,
2524
currentApp: AppsManager.findAppBySlugOrName(this.props.params.appId)
2625
};
27-
},
26+
}
2827

2928
generatePath(path) {
3029
return '/apps/' + this.props.params.appId + '/' + path;
31-
},
30+
}
3231

3332
render() {
3433
if (this.props.params.appId === '_') {
@@ -48,6 +47,11 @@ let AppData = createClass({
4847
</div>
4948
);
5049
}
51-
});
50+
}
51+
52+
AppData.childContextTypes = {
53+
generatePath: PropTypes.func,
54+
currentApp: PropTypes.instanceOf(ParseApp)
55+
};
5256

5357
export default AppData;

src/dashboard/Dashboard.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,16 @@ import {
5454
Switch,
5555
} from 'react-router';
5656
import { Route, Redirect } from 'react-router-dom';
57-
import createClass from 'create-react-class';
5857
import { Helmet } from 'react-helmet';
5958
import Playground from './Data/Playground/Playground.react';
6059

6160
const ShowSchemaOverview = false; //In progress features. Change false to true to work on this feature.
6261

63-
let Empty = createClass({
62+
class Empty extends React.Component {
6463
render() {
6564
return <div>Not yet implemented</div>;
6665
}
67-
});
66+
}
6867

6968
const AccountSettingsPage = () => (
7069
<AccountView section='Account Settings'>

0 commit comments

Comments
 (0)