import React , { useContext } from 'react' ; import { dataCacheCtx } from './ssr/ctx' ; import { useTheme } from './state' ; import useAppState from './useAppState' ; interface Props { routePath : string ; } const PageLoader = React . memo ( ( { routePath } ) => { const Theme = useTheme ( ) ; const loadState = useAppState ( routePath ) ; const dataCache = useContext ( dataCacheCtx ) ; return ( < Theme loadState = { loadState } loadedData = { dataCache } / > ) ; } ) ; export default PageLoader ;