import * as React from 'react' ; import KeepAlive , { AliveScope } from 'react-activation' ; const runtimeModule = ( { wrapperPageComponent , wrapperRouteComponent , modifyRoutesComponent } ) => { const wrapperKeepAlive = ( PageComponent ) => { const { pageConfig = { } } = PageComponent ; if ( pageConfig . keepAlive === false ) { return PageComponent ; } else { const WrappedKeepAlive = ( props ) => { return ( < KeepAlive > < PageComponent { ... props } / > < /KeepAlive>); } ; return WrappedKeepAlive ; } } ; ( wrapperPageComponent || wrapperRouteComponent ) ( wrapperKeepAlive ) ; modifyRoutesComponent ( ( RoutesComponent ) => { return ( props ) => ( < AliveScope > < RoutesComponent { ... props } / > < /AliveScope>); } ) ; } ; export default runtimeModule ;