File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 33
33
},
34
34
"dependencies" : {
35
35
"prop-types" : " 15.x.x" ,
36
- "router-async" : " 0.5.x"
36
+ "router-async" : " 0.5.x" ,
37
+ "serialize-javascript" : " ^1.4.0"
37
38
}
38
39
}
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
2
import * as PropTypes from 'prop-types' ;
3
3
import Router , { initParams , initResult } from './router' ;
4
+ import serialize from 'serialize-javascript' ;
4
5
5
6
export default class ServerRouter extends Router {
6
7
static async init ( opts : initParams ) : Promise < initResult > {
@@ -22,9 +23,9 @@ export default class ServerRouter extends Router {
22
23
return (
23
24
< div >
24
25
{ this . props . children ? this . props . children : < this . state . Component { ...this . state . componentProps } /> }
25
- < script dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ JSON . stringify ( {
26
+ < script dangerouslySetInnerHTML = { { __html : `window.__REACT_ROUTER_ASYNC__=${ serialize ( {
26
27
state : this . state
27
- } ) } ;`} } />
28
+ } , { isJSON : true } ) } ;`} } />
28
29
</ div >
29
30
)
30
31
}
Original file line number Diff line number Diff line change 100
100
path-to-regexp "^1.7.0"
101
101
query-string "^4.3.2"
102
102
103
+ serialize-javascript@^1.4.0 :
104
+ version "1.4.0"
105
+ resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-1.4.0.tgz#7c958514db6ac2443a8abc062dc9f7886a7f6005"
106
+
103
107
setimmediate@^1.0.5 :
104
108
version "1.0.5"
105
109
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
You can’t perform that action at this time.
0 commit comments