Commit 01211338 authored by Shen Chang's avatar Shen Chang

fix(higher): fix TSLint error

parent d19f64d0
{ {
"name": "react-keep-alive", "name": "react-keep-alive",
"version": "0.1.0", "version": "0.2.0",
"description": "Keep the state of the component.", "description": "Keep the state of the component.",
"author": "Shen Chang", "author": "Shen Chang",
"homepage": "https://github.com/Sam618/react-keep-alive", "homepage": "https://github.com/Sam618/react-keep-alive",
......
...@@ -9,7 +9,7 @@ export default function bindLifecycle<P = any>(Component: React.ComponentType<P> ...@@ -9,7 +9,7 @@ export default function bindLifecycle<P = any>(Component: React.ComponentType<P>
const { const {
WrappedComponent, WrappedComponent,
wrappedComponent, wrappedComponent,
} = Component; } = Component as any;
if (WrappedComponent || wrappedComponent) { if (WrappedComponent || wrappedComponent) {
Component = WrappedComponent || wrappedComponent; Component = WrappedComponent || wrappedComponent;
} }
...@@ -121,7 +121,7 @@ export default function bindLifecycle<P = any>(Component: React.ComponentType<P> ...@@ -121,7 +121,7 @@ export default function bindLifecycle<P = any>(Component: React.ComponentType<P>
<BindLifecycleHOC {...props} forwardRef={ref} /> <BindLifecycleHOC {...props} forwardRef={ref} />
)); ));
BindLifecycle.WrappedComponent = Component; (BindLifecycle as any).WrappedComponent = Component;
BindLifecycle.displayName = `bindLifecycle(${getDisplayName(Component)})`; BindLifecycle.displayName = `bindLifecycle(${getDisplayName(Component)})`;
return hoistNonReactStatics( return hoistNonReactStatics(
BindLifecycle, BindLifecycle,
......
...@@ -59,7 +59,7 @@ export default function keepAliveDecorator({ ...@@ -59,7 +59,7 @@ export default function keepAliveDecorator({
const { const {
WrappedComponent, WrappedComponent,
wrappedComponent, wrappedComponent,
} = Component; } = Component as any;
if (WrappedComponent || wrappedComponent) { if (WrappedComponent || wrappedComponent) {
Component = WrappedComponent || wrappedComponent; Component = WrappedComponent || wrappedComponent;
} }
...@@ -476,7 +476,7 @@ export default function keepAliveDecorator({ ...@@ -476,7 +476,7 @@ export default function keepAliveDecorator({
)); ));
} }
KeepAlive.WrappedComponent = Component; (KeepAlive as any).WrappedComponent = Component;
KeepAlive.displayName = `${keepAliveDisplayName}(${displayName})`; KeepAlive.displayName = `${keepAliveDisplayName}(${displayName})`;
return hoistNonReactStatics(KeepAlive, Component); return hoistNonReactStatics(KeepAlive, Component);
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment