From 97808c51e07e2802b2349ec2b59b7e449b48a776 Mon Sep 17 00:00:00 2001 From: Vladimir Metnev Date: Mon, 19 Feb 2018 18:29:36 +0200 Subject: [PATCH] feat(ssr): render Helmet on server in --- src/common/components/Root/index.jsx | 31 ++++++++++++++++++----- src/server/ssr/HTMLComponent.jsx | 38 +++++++++++++--------------- 2 files changed, 43 insertions(+), 26 deletions(-) diff --git a/src/common/components/Root/index.jsx b/src/common/components/Root/index.jsx index 5be7c3a2..74ec164e 100644 --- a/src/common/components/Root/index.jsx +++ b/src/common/components/Root/index.jsx @@ -2,6 +2,7 @@ import React, {Component} from 'react' import {Provider} from 'react-redux' import {IntlProvider, defineMessages, addLocaleData} from 'react-intl' +import Helmet from 'react-helmet' import {APPLICATION_INIT} from 'actions/common' import {ThemeProvider} from 'styled-components' import theme from 'styles/theme' @@ -48,14 +49,10 @@ class Root extends Component { return null } const {SSR, store, history, i18n} = this.props - const routerProps = process.env.BROWSER - ? {history} - : {location: SSR.location, context: SSR.context} + const routerProps = process.env.BROWSER ? {history} : {location: SSR.location, context: SSR.context} return ( - + {/* key={Math.random()} = hack for HMR From https://github.com/webpack/webpack-dev-server/issues/395 */} @@ -63,6 +60,28 @@ class Root extends Component { + + + + Suicrux + + + + + + + + +