Skip to content

Commit 147b3ac

Browse files
authored
Merge pull request #59 from okgrow/fix/hoist-statics
fix(copilot): hoist static props
2 parents 2c3e2c0 + 67c2949 commit 147b3ac

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
}
6262
},
6363
"dependencies": {
64+
"hoist-non-react-statics": "^3.0.1",
6465
"mitt": "^1.1.3"
6566
}
6667
}

src/hocs/copilot.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import PropTypes from 'prop-types';
55
import { View } from 'react-native';
66

77
import mitt from 'mitt';
8+
import hoistStatics from 'hoist-non-react-statics'
89

910
import CopilotModal from '../components/CopilotModal';
1011
import { OFFSET_WIDTH } from '../components/style';
@@ -198,7 +199,7 @@ const copilot = ({
198199
_copilot: PropTypes.object.isRequired,
199200
};
200201

201-
return Copilot;
202+
return hoistStatics(Copilot, WrappedComponent);
202203
};
203204

204205
export default copilot;

yarn.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2859,6 +2859,12 @@ [email protected]:
28592859
version "4.2.1"
28602860
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.1.tgz#9634502aa12c445dd5a7c5734b572bb8738aacbb"
28612861

2862+
hoist-non-react-statics@^3.0.1:
2863+
version "3.0.1"
2864+
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.0.1.tgz#fba3e7df0210eb9447757ca1a7cb607162f0a364"
2865+
dependencies:
2866+
react-is "^16.3.2"
2867+
28622868
home-or-tmp@^2.0.0:
28632869
version "2.0.0"
28642870
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"

0 commit comments

Comments
 (0)