File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import * as React from 'react';
22import * as PropTypes from 'prop-types' ;
33import Router , { initParams , initResult } from './router' ;
44import { Context , stringifyQuery } from 'router-async' ;
5+ import * as serialize from 'serialize-javascript' ;
56
67export default class BrowserRouter extends Router {
78 private history : any ;
@@ -112,9 +113,9 @@ export default class BrowserRouter extends Router {
112113 < div >
113114 { this . props . children ? this . props . children : < this . state . Component { ...this . state . componentProps } /> }
114115 { this . stateFromServer !== null ?
115- < script dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ JSON . stringify ( {
116+ < script dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ serialize ( {
116117 state : this . stateFromServer
117- } ) } ;`} } /> : null
118+ } , { isJSON : true } ) } ;`} } /> : null
118119 }
119120 </ div >
120121 )
You can’t perform that action at this time.
0 commit comments