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';
2
2
import * as PropTypes from 'prop-types' ;
3
3
import Router , { initParams , initResult } from './router' ;
4
4
import { Context , stringifyQuery } from 'router-async' ;
5
+ import * as serialize from 'serialize-javascript' ;
5
6
6
7
export default class BrowserRouter extends Router {
7
8
private history : any ;
@@ -112,9 +113,9 @@ export default class BrowserRouter extends Router {
112
113
< div >
113
114
{ this . props . children ? this . props . children : < this . state . Component { ...this . state . componentProps } /> }
114
115
{ this . stateFromServer !== null ?
115
- < script dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ JSON . stringify ( {
116
+ < script dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ serialize ( {
116
117
state : this . stateFromServer
117
- } ) } ;`} } /> : null
118
+ } , { isJSON : true } ) } ;`} } /> : null
118
119
}
119
120
</ div >
120
121
)
You can’t perform that action at this time.
0 commit comments