File tree Expand file tree Collapse file tree 4 files changed +577
-32
lines changed Expand file tree Collapse file tree 4 files changed +577
-32
lines changed Original file line number Diff line number Diff line change 68
68
"sanitize-filename" : " ^1.6.3" ,
69
69
"stream-template" : " ^0.0.10" ,
70
70
"vite" : " ^2.9.15" ,
71
- "wouter" : " ^2.7.5 "
71
+ "wouter" : " ^2.11.0 "
72
72
},
73
73
"peerDependencies" : {
74
74
"fastify" : " ^4.24.2" ,
Original file line number Diff line number Diff line change @@ -20,22 +20,6 @@ export interface ReactRendererOptions {
20
20
mode : 'sync' | 'streaming'
21
21
}
22
22
23
- const staticLocationHook = ( path = '/' , { record = false } = { } ) => {
24
- // eslint-disable-next-line prefer-const
25
- let hook
26
- const navigate = ( to , { replace } : { replace ?: boolean } = { } ) => {
27
- if ( record ) {
28
- if ( replace ) {
29
- hook . history . pop ( )
30
- }
31
- hook . history . push ( to )
32
- }
33
- }
34
- hook = ( ) => [ path , navigate ]
35
- hook . history = [ path ]
36
- return hook
37
- }
38
-
39
23
export class ReactRenderer implements Renderer {
40
24
static ROUTE_TABLE_ID = '/@fstr!route-table.js'
41
25
@@ -99,7 +83,7 @@ export class ReactRenderer implements Renderer {
99
83
Router ,
100
84
{
101
85
base : render . base ,
102
- hook : staticLocationHook ( destination ) ,
86
+ ssrPath : destination ,
103
87
} ,
104
88
React . createElement (
105
89
Layout ,
Original file line number Diff line number Diff line change 13
13
"fastify-renderer" : " *" ,
14
14
"react" : " *" ,
15
15
"react-dom" : " *" ,
16
- "wouter" : " ^2.7.5 " ,
16
+ "wouter" : " ^2.11.0 " ,
17
17
"path-to-regexp" : " ^6.2.1"
18
18
},
19
19
"devDependencies" : {
You can’t perform that action at this time.
0 commit comments