import React from 'react'; import { renderToString } from 'react-dom/server'; import { createStore } from 'redux'; import { Provider } from 'react-redux'; import App from './components/App'; const appReducer = (state = {}, action) => { return state; } export const renderPage = (radar, pageName) => { // Create a new Redux store instance const store = createStore(appReducer, { ...radar, pageName }); // Render the component to a string const html = renderToString( ) // Grab the initial state from our Redux store const preloadedState = store.getState() // Send the rendered page back to the client return renderFullPage(html, preloadedState); // Save file // return save(fullHtml, pageName); } const renderFullPage = (html, preloadedState) => { return ` AOE Technology Radar - AOE Tech Radar
${html}
` }