Skip to content

Commit 0a9a9e0

Browse files
author
Michal Svrček
committed
hoist-non-react-statics no longer needed
1 parent bb2ea29 commit 0a9a9e0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@
9090
"express-session": "^1.12.1",
9191
"history": "1.17.0",
9292
"file-loader": "^0.8.5",
93-
"hoist-non-react-statics": "^1.0.3",
9493
"http-proxy": "^1.12.0",
9594
"invariant": "^2.2.0",
9695
"less": "^2.5.3",

src/helpers/connectData.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Component } from 'react';
2-
import hoistStatics from 'hoist-non-react-statics';
32

43
/*
54
Note:
@@ -9,15 +8,18 @@ import hoistStatics from 'hoist-non-react-statics';
98

109
export default function connectData(fetchData, fetchDataDeferred) {
1110
return function wrapWithFetchData(WrappedComponent) {
11+
1212
class ConnectData extends Component {
13+
14+
static fetchData = fetchData;
15+
static fetchDataDeferred = fetchDataDeferred;
16+
1317
render() {
1418
return <WrappedComponent {...this.props} />;
1519
}
1620
}
1721

18-
ConnectData.fetchData = fetchData;
19-
ConnectData.fetchDataDeferred = fetchDataDeferred;
20-
21-
return hoistStatics(ConnectData, WrappedComponent);
22+
return ConnectData;
23+
2224
};
2325
}

0 commit comments

Comments
 (0)