Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
feat(ssr/HtmlComponent): use serialize-javascript instead of JSON.str…
Browse files Browse the repository at this point in the history
…ingify

feat(ssr/HtmlComponent): use serialize-javascript instead of
JSON.stringify
  • Loading branch information
Metnew committed Sep 17, 2017
1 parent ebfee5d commit e203edf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/ssr/HtmlComponent.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// @flow
import serealize from 'serialize-javascript'

type args = {
css: string,
App: string,
Expand All @@ -24,8 +26,8 @@ const HtmlComponent = ({
faviconsAssets,
i18n
}: args) => {
const stringifiedState: string = JSON.stringify(initialState)
const stringifiedI18N: string = JSON.stringify(i18n)
const stringifiedState: string = serealize(initialState)
const stringifiedI18N: string = serealize(i18n)
const safeStringifiedState: string = stringifiedState.replace(/</g, '\\u003c')

const createBody = () => {
Expand Down

0 comments on commit e203edf

Please sign in to comment.