Skip to content

Commit

Permalink
fix(higher): fix TSLint error
Browse files Browse the repository at this point in the history
  • Loading branch information
ShenChang618 committed Mar 5, 2019
1 parent d19f64d commit 0121133
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/utils/bindLifecycle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export default function bindLifecycle<P = any>(Component: React.ComponentType<P>
const {
WrappedComponent,
wrappedComponent,
} = Component;
} = Component as any;
if (WrappedComponent || wrappedComponent) {
Component = WrappedComponent || wrappedComponent;
}

const {
componentDidMount = noop,
componentDidUpdate = noop,
Expand Down Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/utils/keepAlive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -476,7 +476,7 @@ export default function keepAliveDecorator({
));
}

KeepAlive.WrappedComponent = Component;
(KeepAlive as any).WrappedComponent = Component;
KeepAlive.displayName = `${keepAliveDisplayName}(${displayName})`;
return hoistNonReactStatics(KeepAlive, Component);
};
Expand Down

0 comments on commit 0121133

Please sign in to comment.