diff --git a/package.json b/package.json
index 4b7fc91..cefe521 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "react-keep-alive",
- "version": "0.1.0",
+ "version": "0.2.0",
"description": "Keep the state of the component.",
"author": "Shen Chang",
"homepage": "https://github.com/Sam618/react-keep-alive",
diff --git a/src/utils/bindLifecycle.tsx b/src/utils/bindLifecycle.tsx
index 7f8e625..c5599b0 100644
--- a/src/utils/bindLifecycle.tsx
+++ b/src/utils/bindLifecycle.tsx
@@ -9,11 +9,11 @@ export default function bindLifecycle
(Component: React.ComponentType
const {
WrappedComponent,
wrappedComponent,
- } = Component;
+ } = Component as any;
if (WrappedComponent || wrappedComponent) {
Component = WrappedComponent || wrappedComponent;
}
-
+
const {
componentDidMount = noop,
componentDidUpdate = noop,
@@ -121,7 +121,7 @@ export default function bindLifecycle
(Component: React.ComponentType
));
- BindLifecycle.WrappedComponent = Component;
+ (BindLifecycle as any).WrappedComponent = Component;
BindLifecycle.displayName = `bindLifecycle(${getDisplayName(Component)})`;
return hoistNonReactStatics(
BindLifecycle,
diff --git a/src/utils/keepAlive.tsx b/src/utils/keepAlive.tsx
index 0116151..b02374a 100644
--- a/src/utils/keepAlive.tsx
+++ b/src/utils/keepAlive.tsx
@@ -59,11 +59,11 @@ export default function keepAliveDecorator({
const {
WrappedComponent,
wrappedComponent,
- } = Component;
+ } = Component as any;
if (WrappedComponent || wrappedComponent) {
Component = WrappedComponent || wrappedComponent;
}
-
+
const {
componentDidMount = noop,
componentDidUpdate = noop,
@@ -476,7 +476,7 @@ export default function keepAliveDecorator({
));
}
- KeepAlive.WrappedComponent = Component;
+ (KeepAlive as any).WrappedComponent = Component;
KeepAlive.displayName = `${keepAliveDisplayName}(${displayName})`;
return hoistNonReactStatics(KeepAlive, Component);
};