mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-29 21:21:19 +10:00
Fix server side rendering having the initial store state
This commit is contained in:
parent
3f20100e40
commit
61d7470fa7
1 changed files with 5 additions and 1 deletions
|
|
@ -67,7 +67,11 @@ ServerApp.propTypes = { url: string.isRequired, context: any.isRequired, store:
|
|||
* - {Object} head: Application head metadata from react-helmet
|
||||
*/
|
||||
export const renderApp = (url, serverContext, preloadedState) => {
|
||||
const store = configureStore(preloadedState);
|
||||
// Pass `null` as the SDK instance since we're only rendering the
|
||||
// component tree with the preloaded store state and components
|
||||
// shouldn't do any SDK calls in the (server) rendering lifecycle.
|
||||
const store = configureStore(null, preloadedState);
|
||||
|
||||
const body = ReactDOMServer.renderToString(
|
||||
<ServerApp url={url} context={serverContext} store={store} />
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue