import React from 'react' ; import ReactDOM from 'react-dom/server' ; import { StaticRouter } from 'react-router-dom' ; import ssrData from '/@react-pages/ssrData' ; import App from '../App' ; import { dataCacheCtx } from './ctx' ; import type { PagesLoaded } from '../../../clientTypes' ; const dataCache = ssrData ; export function renderToString ( url ) { return ReactDOM . renderToString ( < StaticRouter basename = { import . meta . env . BASE_URL ?. replace ( /\/$/ , '' ) } location = { url } > < dataCacheCtx . Provider value = { dataCache } > < App /> < /dataCacheCtx.Provider> < /StaticRouter>); } export { ssrData } ;