Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// analytics tracking
});
*/
ThirdPartyJs.setThirdPartyGlobals();
function renderedApp() {
browserHistory.location.hash = originalHash;
store.dispatch(initialLoadActionCreator());
loadAllThirdPartyJs(env);
document.documentElement.className +=
document.documentElement.className === '' ? 'hydrated' : ' hydrated';
}
// eslint-disable-next-line no-restricted-globals
const branch = matchRoutes(routes, location.pathname);
const preloadChunks = branch.reduce(function matchMap(list, { route }) {
if (route.preloadChunk) {
list.push(route.preloadChunk);
}
return list;
}, []);
function hydrateApp() {
try {
hydrate(
,
window.document,
renderedApp
);
} catch (err) {
// fire ad code here to still show ads
app.use('*', (req, res) => {
cookies.setRawCookies(req.headers.cookie);
const history = createHistory(req.originalUrl);
const store = configureStore(history);
const routes = createRoutes(store);
const preLoaders = matchRoutes(routes, req.url)
.filter(({ route }) => route.component && route.component.preLoad)
.map(({ route, match }) => route.component.preLoad(match, req))
.reduce((result, preLoader) => result.concat(preLoader), []);
const runTasks = store.runSaga(waitAll(preLoaders));
runTasks.done.then(() => {
const sheet = new ServerStyleSheet();
const routerContext = {};
const helmetContext = {};
const modules = [];
const component = (
modules.push(moduleName)}>