react-next-keep-alive
Version:
Module for caching views in next.js
16 lines (15 loc) • 591 B
TypeScript
import React, { ReactElement } from 'react';
import { KeepAliveName, KeepAliveOptsProps } from './provider';
type KeepAliveProps = {
children: ReactElement;
};
declare const withKeepAlive: (Component: (props?: Object) => JSX.Element, name: KeepAliveName, opts?: KeepAliveOptsProps) => {
(props: KeepAliveProps): React.JSX.Element;
getInitialProps: any;
keepAlive: {
name: KeepAliveName;
keepScrollEnabled: boolean | undefined;
applyNewProps: boolean | ((cachedProps: any, newProps: any) => Object) | undefined;
};
};
export default withKeepAlive;