From 012113382c9828f29c5a4b4d1049fae5a7b23d16 Mon Sep 17 00:00:00 2001 From: Shen Chang Date: Tue, 5 Mar 2019 20:03:03 +0800 Subject: [PATCH] fix(higher): fix TSLint error --- package.json | 2 +- src/utils/bindLifecycle.tsx | 6 +++--- src/utils/keepAlive.tsx | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) 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); };