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 11import * as React from 'react' ;
22import Router , { initParams , initResult } from './router' ;
3+ import * as serialize from 'serialize-javascript' ;
34
45export default class ServerRouter extends Router {
56 static async init ( opts : initParams ) : Promise < initResult > {
@@ -14,9 +15,9 @@ export default class ServerRouter extends Router {
1415 return (
1516 < React . Fragment >
1617 { 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 ( {
1819 state : this . state
19- } ) } ;`} } />
20+ } , { isJSON : true } ) } ;`} } />
2021 </ React . Fragment >
2122 )
2223 }
You can’t perform that action at this time.
0 commit comments