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 6868 "sanitize-filename" : " ^1.6.3" ,
6969 "stream-template" : " ^0.0.10" ,
7070 "vite" : " ^2.9.15" ,
71- "wouter" : " ^2.7.5 "
71+ "wouter" : " ^2.11.0 "
7272 },
7373 "peerDependencies" : {
7474 "fastify" : " ^4.24.2" ,
Original file line number Diff line number Diff line change @@ -20,22 +20,6 @@ export interface ReactRendererOptions {
2020 mode : 'sync' | 'streaming'
2121}
2222
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-
3923export class ReactRenderer implements Renderer {
4024 static ROUTE_TABLE_ID = '/@fstr!route-table.js'
4125
@@ -99,7 +83,7 @@ export class ReactRenderer implements Renderer {
9983 Router ,
10084 {
10185 base : render . base ,
102- hook : staticLocationHook ( destination ) ,
86+ ssrPath : destination ,
10387 } ,
10488 React . createElement (
10589 Layout ,
Original file line number Diff line number Diff line change 1313 "fastify-renderer" : " *" ,
1414 "react" : " *" ,
1515 "react-dom" : " *" ,
16- "wouter" : " ^2.7.5 " ,
16+ "wouter" : " ^2.11.0 " ,
1717 "path-to-regexp" : " ^6.2.1"
1818 },
1919 "devDependencies" : {
You can’t perform that action at this time.
0 commit comments