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 1
1
import * as React from 'react' ;
2
2
import Router , { initParams , initResult } from './router' ;
3
+ import * as serialize from 'serialize-javascript' ;
3
4
4
5
export default class ServerRouter extends Router {
5
6
static async init ( opts : initParams ) : Promise < initResult > {
@@ -14,9 +15,9 @@ export default class ServerRouter extends Router {
14
15
return (
15
16
< React . Fragment >
16
17
{ this . props . children ? this . props . children : < this . state . Component { ...this . state . componentProps } /> }
17
- < script id = "__react-router-async" dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ JSON . stringify ( {
18
+ < script id = "__react-router-async" dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ serialize ( {
18
19
state : this . state
19
- } ) } ;`} } />
20
+ } , { isJSON : true } ) } ;`} } />
20
21
</ React . Fragment >
21
22
)
22
23
}
You can’t perform that action at this time.
0 commit comments