Commit 01211338 authored by Shen Chang's avatar Shen Chang

fix(higher): fix TSLint error

parent d19f64d0
{
"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",
......
......@@ -9,7 +9,7 @@ export default function bindLifecycle<P = any>(Component: React.ComponentType<P>
const {
WrappedComponent,
wrappedComponent,
} = Component;
} = Component as any;
if (WrappedComponent || wrappedComponent) {
Component = WrappedComponent || wrappedComponent;
}
......@@ -121,7 +121,7 @@ export default function bindLifecycle<P = any>(Component: React.ComponentType<P>
<BindLifecycleHOC {...props} forwardRef={ref} />
));
BindLifecycle.WrappedComponent = Component;
(BindLifecycle as any).WrappedComponent = Component;
BindLifecycle.displayName = `bindLifecycle(${getDisplayName(Component)})`;
return hoistNonReactStatics(
BindLifecycle,
......
......@@ -59,7 +59,7 @@ export default function keepAliveDecorator({
const {
WrappedComponent,
wrappedComponent,
} = Component;
} = Component as any;
if (WrappedComponent || wrappedComponent) {
Component = WrappedComponent || wrappedComponent;
}
......@@ -476,7 +476,7 @@ export default function keepAliveDecorator({
));
}
KeepAlive.WrappedComponent = Component;
(KeepAlive as any).WrappedComponent = Component;
KeepAlive.displayName = `${keepAliveDisplayName}(${displayName})`;
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