For instance in a react/redux serverside rendered application you can pass the state to the client like this:
ie:
import { renderToString } from 'react-dom/server'
function handleRender(req, res) {
// Create a new Redux store instance
const store = createStore(counterApp)
// Render the component to a string
const html = renderToString(
<Provider store={store}>
<App />
</Provider>
)
// Grab the initial state from our Redux store
const preloadedState = store.getState()
// Send the rendered page back to the client
res.send(renderFullPage(html, preloadedState))
}
taken from: http://redux.js.org/docs/recipes/ServerRendering.html
An example that shows how to achieve the equivalent in marko would be very helpful.
I'm just starting to explore marko, amazing stuff so far, congrats
I'm trying to figure out how all the pieces would fit together to build single page isomorphic apps, kind of like what Nuxt does
For instance in a react/redux serverside rendered application you can pass the state to the client like this:
ie:
taken from: http://redux.js.org/docs/recipes/ServerRendering.html
An example that shows how to achieve the equivalent in marko would be very helpful.
I'm just starting to explore marko, amazing stuff so far, congrats
I'm trying to figure out how all the pieces would fit together to build single page isomorphic apps, kind of like what Nuxt does